List of usage examples for org.jfree.date SerialDate createInstance
public static SerialDate createInstance(final int day, final int month, final int yyyy)
From source file:org.jfree.data.time.Day.java
/** * Constructs a new one day time period. * * @param day the day-of-the-month.//from w w w. j av a 2 s . co m * @param month the month (1 to 12). * @param year the year (1900 <= year <= 9999). */ public Day(int day, int month, int year) { this.serialDate = SerialDate.createInstance(day, month, year); peg(Calendar.getInstance()); }
From source file:org.jfree.data.time.Day.java
/** * Constructs a new instance, based on a particular date/time and time zone. * * @param time the date/time (<code>null</code> not permitted). * @param zone the time zone (<code>null</code> not permitted). * @param locale the locale (<code>null</code> not permitted). *///from w w w . j av a 2 s. c om public Day(Date time, TimeZone zone, Locale locale) { ParamChecks.nullNotPermitted(time, "time"); ParamChecks.nullNotPermitted(zone, "zone"); ParamChecks.nullNotPermitted(locale, "locale"); Calendar calendar = Calendar.getInstance(zone, locale); calendar.setTime(time); int d = calendar.get(Calendar.DAY_OF_MONTH); int m = calendar.get(Calendar.MONTH) + 1; int y = calendar.get(Calendar.YEAR); this.serialDate = SerialDate.createInstance(d, m, y); peg(calendar); }