/** * Creates a millisecond. * * @param time the date-time ({@code null} not permitted). * @param zone the time zone ({@code null} not permitted). * @param locale the locale ({@code null} not permitted). * * @since 1.0.13 */ public Millisecond(Date time, TimeZone zone, Locale locale) { Calendar calendar = Calendar.getInstance(zone, locale); calendar.setTime(time); this.millisecond = calendar.get(Calendar.MILLISECOND); this.second = (byte) calendar.get(Calendar.SECOND); this.minute = (byte) calendar.get(Calendar.MINUTE); this.hour = (byte) calendar.get(Calendar.HOUR_OF_DAY); this.day = new Day(time, zone, locale); peg(calendar); }
/** * Creates a millisecond. * * @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). * * @since 1.0.13 */ public Millisecond(Date time, TimeZone zone, Locale locale) { Calendar calendar = Calendar.getInstance(zone, locale); calendar.setTime(time); this.millisecond = calendar.get(Calendar.MILLISECOND); this.second = (byte) calendar.get(Calendar.SECOND); this.minute = (byte) calendar.get(Calendar.MINUTE); this.hour = (byte) calendar.get(Calendar.HOUR_OF_DAY); this.day = new Day(time, zone, locale); peg(calendar); }
/** * Constructs a millisecond. * * @param millisecond the millisecond (0-999). * @param second the second. */ public Millisecond(int millisecond, Second second) { this.millisecond = millisecond; this.second = (byte) second.getSecond(); this.minute = (byte) second.getMinute().getMinute(); this.hour = (byte) second.getMinute().getHourValue(); this.day = second.getMinute().getDay(); peg(Calendar.getInstance()); }
/** * Constructs a millisecond. * * @param millisecond the millisecond (0-999). * @param second the second. */ public Millisecond(int millisecond, Second second) { this.millisecond = millisecond; this.second = (byte) second.getSecond(); this.minute = (byte) second.getMinute().getMinute(); this.hour = (byte) second.getMinute().getHourValue(); this.day = second.getMinute().getDay(); peg(Calendar.getInstance()); }