secConverter.normalize(true);
Time time = new Time(); time.set(4, 10, 2007); // set the date to Nov 4, 2007, 12am time.normalize(false); // this sets isDst = 1 time.monthDay += 1; // changes the date to Nov 5, 2007, 12am millis = time.toMillis(false); // millis is Nov 4, 2007, 11pm millis = time.toMillis(true); // millis is Nov 5, 2007, 12am
Time time = new Time(); time.setToNow(); ++time.hour; // increase 1 hour time.normalize(false);
Time t = new Time(); t.dayOfMonth = dialog.getDayOfMonth(); t.month = dialog.getMonth(); t.year = dialog.getYear(); t.normalize( false );
public static final long utcMillisNextHour() { Time t = new Time(); t.setToNow(); t.hour++; t.minute = 0; t.second = 0; return t.normalize(true); }
private final long getTimeImpl() { if (cdate != null && !cdate.isNormalized()) { normalize(); } return fastTime; }
private final long getTimeImpl() { if (cdate != null && !cdate.isNormalized()) { normalize(); } return fastTime; }
Time time = new Time(); String date = "20081013T160000Z"; time.parse(date); long millis = time.normalize(false);
/** * Returns the number of minutes past the hour represented by this date, * as interpreted in the local time zone. * The value returned is between <code>0</code> and <code>59</code>. * * @return the number of minutes past the hour represented by this date. * @see java.util.Calendar * @deprecated As of JDK version 1.1, * replaced by <code>Calendar.get(Calendar.MINUTE)</code>. */ @Deprecated public int getMinutes() { return normalize().getMinutes(); }
/** * Returns a value that is the result of subtracting 1900 from the * year that contains or begins with the instant in time represented * by this <code>Date</code> object, as interpreted in the local * time zone. * * @return the year represented by this date, minus 1900. * @see java.util.Calendar * @deprecated As of JDK version 1.1, * replaced by <code>Calendar.get(Calendar.YEAR) - 1900</code>. */ @Deprecated public int getYear() { return normalize().getYear() - 1900; }
/** * Returns the number of minutes past the hour represented by this date, * as interpreted in the local time zone. * The value returned is between <code>0</code> and <code>59</code>. * * @return the number of minutes past the hour represented by this date. * @see java.util.Calendar * @deprecated As of JDK version 1.1, * replaced by <code>Calendar.get(Calendar.MINUTE)</code>. */ @Deprecated public int getMinutes() { return normalize().getMinutes(); }
/** * Returns a value that is the result of subtracting 1900 from the * year that contains or begins with the instant in time represented * by this <code>Date</code> object, as interpreted in the local * time zone. * * @return the year represented by this date, minus 1900. * @see java.util.Calendar * @deprecated As of JDK version 1.1, * replaced by <code>Calendar.get(Calendar.YEAR) - 1900</code>. */ @Deprecated public int getYear() { return normalize().getYear() - 1900; }
/** * Returns the number of seconds past the minute represented by this date. * The value returned is between <code>0</code> and <code>61</code>. The * values <code>60</code> and <code>61</code> can only occur on those * Java Virtual Machines that take leap seconds into account. * * @return the number of seconds past the minute represented by this date. * @see java.util.Calendar * @deprecated As of JDK version 1.1, * replaced by <code>Calendar.get(Calendar.SECOND)</code>. */ @Deprecated public int getSeconds() { return normalize().getSeconds(); }
/** * Returns the hour represented by this <tt>Date</tt> object. The * returned value is a number (<tt>0</tt> through <tt>23</tt>) * representing the hour within the day that contains or begins * with the instant in time represented by this <tt>Date</tt> * object, as interpreted in the local time zone. * * @return the hour represented by this date. * @see java.util.Calendar * @deprecated As of JDK version 1.1, * replaced by <code>Calendar.get(Calendar.HOUR_OF_DAY)</code>. */ @Deprecated public int getHours() { return normalize().getHours(); }
/** * Returns a number representing the month that contains or begins * with the instant in time represented by this <tt>Date</tt> object. * The value returned is between <code>0</code> and <code>11</code>, * with the value <code>0</code> representing January. * * @return the month represented by this date. * @see java.util.Calendar * @deprecated As of JDK version 1.1, * replaced by <code>Calendar.get(Calendar.MONTH)</code>. */ @Deprecated public int getMonth() { return normalize().getMonth() - 1; // adjust 1-based to 0-based }
/** * Returns the hour represented by this <tt>Date</tt> object. The * returned value is a number (<tt>0</tt> through <tt>23</tt>) * representing the hour within the day that contains or begins * with the instant in time represented by this <tt>Date</tt> * object, as interpreted in the local time zone. * * @return the hour represented by this date. * @see java.util.Calendar * @deprecated As of JDK version 1.1, * replaced by <code>Calendar.get(Calendar.HOUR_OF_DAY)</code>. */ @Deprecated public int getHours() { return normalize().getHours(); }
/** * Returns the number of seconds past the minute represented by this date. * The value returned is between <code>0</code> and <code>61</code>. The * values <code>60</code> and <code>61</code> can only occur on those * Java Virtual Machines that take leap seconds into account. * * @return the number of seconds past the minute represented by this date. * @see java.util.Calendar * @deprecated As of JDK version 1.1, * replaced by <code>Calendar.get(Calendar.SECOND)</code>. */ @Deprecated public int getSeconds() { return normalize().getSeconds(); }
/** * Returns a number representing the month that contains or begins * with the instant in time represented by this <tt>Date</tt> object. * The value returned is between <code>0</code> and <code>11</code>, * with the value <code>0</code> representing January. * * @return the month represented by this date. * @see java.util.Calendar * @deprecated As of JDK version 1.1, * replaced by <code>Calendar.get(Calendar.MONTH)</code>. */ @Deprecated public int getMonth() { return normalize().getMonth() - 1; // adjust 1-based to 0-based }
/** * Returns the day of the month represented by this <tt>Date</tt> object. * The value returned is between <code>1</code> and <code>31</code> * representing the day of the month that contains or begins with the * instant in time represented by this <tt>Date</tt> object, as * interpreted in the local time zone. * * @return the day of the month represented by this date. * @see java.util.Calendar * @deprecated As of JDK version 1.1, * replaced by <code>Calendar.get(Calendar.DAY_OF_MONTH)</code>. * @deprecated */ @Deprecated public int getDate() { return normalize().getDayOfMonth(); }
java.lang.Thread.State: BLOCKED (on object monitor) at sun.awt.AppContext.get(AppContext.java:572) - waiting to lock <0x0000000705490070> (a java.util.HashMap) at sun.awt.AppContext$6.get(AppContext.java:774) at java.util.TimeZone.getDefaultInAppContext(TimeZone.java:637) at java.util.TimeZone.getDefaultRef(TimeZone.java:523) at java.util.Date.normalize(Date.java:1176) at java.util.Date.toString(Date.java:1010)