Please support java.util.Calendar by default
See original GitHub issueWhat steps will reproduce the problem?
1. Create a Class Customer with
Customer {
String name;
Calendar timestamp;
}
2. Try Serializing this class and you will get an exception for Calendar
3.
Customer c = new Customer();
c.setName("jjj sdss");
c.setRegTime(Calendar.getInstance());
Gson gson = new Gson();
String json = gson.toJson(c);
What is the expected output? What do you see instead?
Calendar seems to be not supported
What version of the product are you using? On what operating system?
Please provide any additional information below.
java.lang.RuntimeException: Unable to invoke no-args constructor for class
java.util.Calendar. Register an InstanceCreator with Gson for this type may
fix this problem.
Can java.util.Calendar be supported by default ???
Original issue reported on code.google.com by njun...@gmail.com
on 5 Mar 2009 at 8:01
Issue Analytics
- State:
- Created 9 years ago
- Comments:5
Top Results From Across the Web
What is the default timezone for java.util.Calendar.?
Gets a calendar using the default time zone and locale. The Calendar returned is based on the current time in the default time...
Read more >java.util.Calendar - Javatpoint
No Method Description
7. protected void complete() It fills any unset fields in the calendar fields.
19. public int getFirstDayOfWeek() Returns the first day of...
Read more >Calendar (Java Platform SE 7 ) - Oracle Help Center
The default value of each field may vary by concrete calendar systems. For example, in GregorianCalendar , the default of a field is...
Read more >java.util Class GregorianCalendar
GregorianCalendar is a concrete subclass of Calendar and provides the standard calendar used by most of the world. The standard (Gregorian) calendar has...
Read more >getFirstDayOfWeek() in java.util.Calendar returns 1 for non ...
Component: core-libs | Sub-Component: java.util:i18n. ... we should develop applications in diferent languages that are not supported by default in the JDK.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It would be nice to support
java.util.Calendar
model attributes for converting from an ISO 8601 format like2016-02-29T15:00:00+02:00
, in order to store both the UTC datetime and the time zone data.@GoogleCodeExporter how would I parse a string in format “yyyy-MM-dd” into Calendar object using GSON ??