Lines Matching defs:calendar

23  * The implementation of <code>XMPDateTime</code>. Internally a <code>calendar</code> is used
46 * The nano seconds take micro and nano seconds, while the milli seconds are in the calendar.
62 * Creates an <code>XMPDateTime</code>-instance from a calendar.
64 * @param calendar a <code>Calendar</code>
66 public XMPDateTimeImpl(Calendar calendar)
68 // extract the date and timezone from the calendar provided
69 Date date = calendar.getTime();
70 TimeZone zone = calendar.getTimeZone();
72 // put that date into a calendar the pretty much represents ISO8601
100 GregorianCalendar calendar = new GregorianCalendar(timeZone);
101 calendar.setTime(date);
102 this.year = calendar.get(Calendar.YEAR);
103 this.month = calendar.get(Calendar.MONTH) + 1; // cal is from 0..12
104 this.day = calendar.get(Calendar.DAY_OF_MONTH);
105 this.hour = calendar.get(Calendar.HOUR_OF_DAY);
106 this.minute = calendar.get(Calendar.MINUTE);
107 this.second = calendar.get(Calendar.SECOND);
108 this.nanoSeconds = calendar.get(Calendar.MILLISECOND) * 1000000;
316 GregorianCalendar calendar = (GregorianCalendar) Calendar.getInstance(Locale.US);
317 calendar.setGregorianChange(new Date(Long.MIN_VALUE));
318 calendar.setTimeZone(timeZone);
319 calendar.set(Calendar.YEAR, year);
320 calendar.set(Calendar.MONTH, month - 1);
321 calendar.set(Calendar.DAY_OF_MONTH, day);
322 calendar.set(Calendar.HOUR_OF_DAY, hour);
323 calendar.set(Calendar.MINUTE, minute);
324 calendar.set(Calendar.SECOND, second);
325 calendar.set(Calendar.MILLISECOND, nanoSeconds / 1000000);
326 return calendar;