java - How to set a BCE year using GregorianCalendar -


I have an assignment that changes the date from one calendar system to another.

The document for Gregorian calendar is to suggest that you can use dates with BCE years, but I do not know how if I only made years negative Given, i.e.

  Gregorian calendar calories = new Gregorian calendars (-20, 1, 2, 3, 0, 0); Println (cal.getTime.toString ());  

This 'sun is printed Feb 02 03:00 GMT-05: 00 21', which is clearly not correct.

You have to set ERA in BC (BC is a static field).

Standard (Gregorian) Calendar 2 Era, BC and Eddie.

For example

  calendar.set (calendar.ara, gregorian calendar.bc);  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -