java.util.Date.normalize()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(272)

本文整理了Java中java.util.Date.normalize()方法的一些代码示例,展示了Date.normalize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Date.normalize()方法的具体详情如下:
包路径:java.util.Date
类名称:Date
方法名:normalize

Date.normalize介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

secConverter.normalize(true);

代码示例来源:origin: stackoverflow.com

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

代码示例来源:origin: stackoverflow.com

Time time = new Time();
time.setToNow();

++time.hour; // increase 1 hour
time.normalize(false);

代码示例来源:origin: stackoverflow.com

Time t = new Time();
t.dayOfMonth = dialog.getDayOfMonth();
t.month = dialog.getMonth();
t.year = dialog.getYear();
t.normalize( false );

代码示例来源:origin: stackoverflow.com

public static final long utcMillisNextHour() {
  Time t = new Time();
  t.setToNow();
  t.hour++;
  t.minute = 0;
  t.second = 0;
  return t.normalize(true);
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

private final long getTimeImpl() {
  if (cdate != null && !cdate.isNormalized()) {
    normalize();
  }
  return fastTime;
}

代码示例来源:origin: jtulach/bck2brwsr

private final long getTimeImpl() {
  if (cdate != null && !cdate.isNormalized()) {
    normalize();
  }
  return fastTime;
}

代码示例来源:origin: stackoverflow.com

Time time = new Time();
String date = "20081013T160000Z";
time.parse(date);
long millis = time.normalize(false);

代码示例来源:origin: org.apidesign.bck2brwsr/emul

/**
 * 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();
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

/**
 * 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;
}

代码示例来源:origin: jtulach/bck2brwsr

/**
 * 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();
}

代码示例来源:origin: jtulach/bck2brwsr

/**
 * 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;
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

/**
 * 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();
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

/**
 * 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();
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

/**
 * 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
}

代码示例来源:origin: jtulach/bck2brwsr

/**
 * 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();
}

代码示例来源:origin: jtulach/bck2brwsr

/**
 * 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();
}

代码示例来源:origin: jtulach/bck2brwsr

/**
 * 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
}

代码示例来源:origin: jtulach/bck2brwsr

/**
 * 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();
}

代码示例来源:origin: stackoverflow.com

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)

相关文章