java.util.TimeZone.observesDaylightTime()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(142)

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

TimeZone.observesDaylightTime介绍

[英]Returns true if this TimeZone is currently in Daylight Saving Time, or if a transition from Standard Time to Daylight Saving Time occurs at any future time.

The default implementation returns true if useDaylightTime() or inDaylightTime(new Date())returns true.
[中]如果此时区当前处于夏令时,或者如果在未来任何时间发生从标准时间到夏令时的转换,则返回true。
如果useDaylightTime()或inDaylightTime(new Date())返回true,则默认实现将返回true。

代码示例

代码示例来源:origin: google/error-prone

if (timeZone.observesDaylightTime()) {

代码示例来源:origin: com.ibm.icu/icu4j-localespi

@Override
public boolean observesDaylightTime() {
  return fJdkTz.observesDaylightTime();
}

代码示例来源:origin: qaprosoft/carina

public static boolean isDaylightTime(String tz) {
  try {
    return DateTimeZone.forID(tz).toTimeZone().observesDaylightTime();
  } catch (Exception e) {
    LOGGER.error(e);
    return false;
  }
}

代码示例来源:origin: com.qaprosoft/carina-utils

public static boolean isDaylightTime(String tz) {
  try {
    return DateTimeZone.forID(tz).toTimeZone().observesDaylightTime();
  } catch (Exception e) {
    LOGGER.error(e);
    return false;
  }
}

代码示例来源:origin: Gurux/gurux.dlms.java

if (dst) {
  if (tz.observesDaylightTime()
      && tz.getRawOffset() / 60000 == deviation - 60) {
    return tz;
  for (int pos = 0; pos != ids.length; ++pos) {
    tz = TimeZone.getTimeZone(ids[pos]);
    if (tz.observesDaylightTime()
        && tz.getRawOffset() / 60000 == deviation - 60) {
      break;
if (!tz.observesDaylightTime()
    && tz.getRawOffset() / 60000 == deviation) {
  return tz;

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

System.out.format("raw offset=%f hours\n", tz.getRawOffset() / 1000f / 60f / 60f);
System.out.format("dstSaving=%f minutes\n", tz.getDSTSavings() / 1000f / 60f);
System.out.format("observesDST=%b\n", tz.observesDaylightTime());

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

new DecimalFormat("0.##").format(offset));
if (tz.observesDaylightTime()) {
  posixSpec.format("%s", tz.getDisplayName(true, TimeZone.SHORT));

代码示例来源:origin: Gurux/gurux.dlms.java

if (!enabled && now.getTimeZone().observesDaylightTime()) {
  tm.getStatus().remove(ClockStatus.DAYLIGHT_SAVE_ACTIVE);
  tm.getMeterCalendar().add(Calendar.MINUTE, -deviation);

代码示例来源:origin: com.google.errorprone/error_prone_core

if (timeZone.observesDaylightTime()) {

代码示例来源:origin: org.vx68k.quercus/quercus

if (_timeZone.observesDaylightTime()) {

相关文章