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

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

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

Date.UTC介绍

[英]Returns the millisecond value of the specified date and time in GMT.
[中]

代码示例

代码示例来源:origin: robovm/robovm

hour -= zoneOffset;
return UTC(year - 1900, month, date, hour, minute, second);

代码示例来源:origin: EvoSuite/evosuite

public static long UTC(int year,
      int month,
      int date,
      int hrs,
      int min,
      int sec) {
    return java.util.Date.UTC(year, month, date, hrs, min, sec);
  }
}

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

//date.setTimeZone(TimeZone.getTimeZone("UTC"));
date.set(Calendar.HOUR_OF_DAY, 0);
Date utcDate = date.getTime();
utcDate.UTC(2014, 9, 1, 26, 1, 0);
System.out.println(utcDate.toGMTString() + " " + date.getTimeInMillis());

代码示例来源:origin: software.amazon.ion/ion-java

/**
 * Returns a number representing the Timestamp's point in time that is
 * the number of milliseconds (<em>ignoring</em> any fractional milliseconds)
 * from the epoch.
 * <p>
 * This method will return the same result for all Timestamps representing
 * the same point in time, regardless of the local offset.
 *
 * @return
 *          number of milliseconds (<em>ignoring</em> any fractional
 *          milliseconds) from the epoch (1970-01-01T00:00:00.000Z)
 */
@SuppressWarnings("deprecation")
public long getMillis()
{
  //                                        month is 0 based for Date
  long millis = Date.UTC(this._year - 1900, this._month - 1, this._day, this._hour, this._minute, this._second);
  if (this._fraction != null) {
    int frac = this._fraction.movePointRight(3).intValue();
    millis += frac;
  }
  return millis;
}

代码示例来源:origin: Nextdoor/bender

/**
 * Returns a number representing the Timestamp's point in time that is
 * the number of milliseconds (<em>ignoring</em> any fractional milliseconds)
 * from the epoch.
 * <p>
 * This method will return the same result for all Timestamps representing
 * the same point in time, regardless of the local offset.
 *
 * @return
 *          number of milliseconds (<em>ignoring</em> any fractional
 *          milliseconds) from the epoch (1970-01-01T00:00:00.000Z)
 */
@SuppressWarnings("deprecation")
public long getMillis()
{
  //                                        month is 0 based for Date
  long millis = Date.UTC(this._year - 1900, this._month - 1, this._day, this._hour, this._minute, this._second);
  if (this._fraction != null) {
    int frac = this._fraction.movePointRight(3).intValue();
    millis += frac;
  }
  return millis;
}

代码示例来源:origin: nmorel/gwt-jackson

@SuppressWarnings("deprecation")
public static long getUTCTime( int year, int month, int day, int hour, int minute, int second, int milli ) {
  return Date.UTC( year - 1900, month - 1, day, hour, minute, second ) + milli;
}

代码示例来源:origin: software.amazon.ion/ion-java

case MINUTE:
case SECOND:
  millis = Date.UTC(this._year - 1900, this._month - 1, this._day, this._hour, this._minute, this._second);
  dec = BigDecimal.valueOf(millis);
  if (_fraction != null) {

代码示例来源:origin: Nextdoor/bender

case MINUTE:
case SECOND:
  millis = Date.UTC(this._year - 1900, this._month - 1, this._day, this._hour, this._minute, this._second);
  dec = BigDecimal.valueOf(millis);
  if (_fraction != null) {

代码示例来源:origin: EvoSuite/evosuite

@SuppressWarnings("deprecation")
public static long UTC(int year, int month, int date,
            int hrs, int min, int sec) {
  Capturer.capture(Instrumenter.CAPTURE_ID_JAVA_UTIL_DATE, CaptureUtil.loadClass("java/util/Date"), "UTC", "(IIIIII)J", new Object[] {year, month, date, hrs, min, sec});
  long ret = java.util.Date.UTC(year, month, date, hrs, min, sec);
  Capturer.enable(Instrumenter.CAPTURE_ID_JAVA_UTIL_DATE, CaptureUtil.loadClass("java/util/Date"), ret);
  return ret;
}

代码示例来源:origin: MobiVM/robovm

hour -= zoneOffset;
return UTC(year - 1900, month, date, hour, minute, second);

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

hour -= zoneOffset;
return UTC(year - 1900, month, date, hour, minute, second);

代码示例来源:origin: com.bugvm/bugvm-rt

hour -= zoneOffset;
return UTC(year - 1900, month, date, hour, minute, second);

代码示例来源:origin: FlexoVM/flexovm

hour -= zoneOffset;
return UTC(year - 1900, month, date, hour, minute, second);

代码示例来源:origin: ibinti/bugvm

hour -= zoneOffset;
return UTC(year - 1900, month, date, hour, minute, second);

代码示例来源:origin: com.gluonhq/robovm-rt

hour -= zoneOffset;
return UTC(year - 1900, month, date, hour, minute, second);

代码示例来源:origin: org.w3c.jigsaw/jigsaw

y = parseInt(buf, ps) - 1900;
return Date.UTC(y, m, d, hh, mm, ss);

相关文章