gpt4 book ai didi

libcore.util.ZoneInfo.getOffset()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 03:33:31 28 4
gpt4 key购买 nike

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

ZoneInfo.getOffset介绍

暂无

代码示例

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

@Override
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) {
  // XXX This assumes Gregorian always; Calendar switches from
  // Julian to Gregorian in 1582.  What calendar system are the
  // arguments supposed to come from?
  long calc = (year / 400) * MILLISECONDS_PER_400_YEARS;
  year %= 400;
  calc += year * (365 * MILLISECONDS_PER_DAY);
  calc += ((year + 3) / 4) * MILLISECONDS_PER_DAY;
  if (year > 0) {
    calc -= ((year - 1) / 100) * MILLISECONDS_PER_DAY;
  }
  boolean isLeap = (year == 0 || (year % 4 == 0 && year % 100 != 0));
  int[] mlen = isLeap ? LEAP : NORMAL;
  calc += mlen[month] * MILLISECONDS_PER_DAY;
  calc += (day - 1) * MILLISECONDS_PER_DAY;
  calc += millis;
  calc -= mRawOffset;
  calc -= UNIX_OFFSET;
  return getOffset(calc);
}

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

@Override
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) {
  // XXX This assumes Gregorian always; Calendar switches from
  // Julian to Gregorian in 1582.  What calendar system are the
  // arguments supposed to come from?
  long calc = (year / 400) * MILLISECONDS_PER_400_YEARS;
  year %= 400;
  calc += year * (365 * MILLISECONDS_PER_DAY);
  calc += ((year + 3) / 4) * MILLISECONDS_PER_DAY;
  if (year > 0) {
    calc -= ((year - 1) / 100) * MILLISECONDS_PER_DAY;
  }
  boolean isLeap = (year == 0 || (year % 4 == 0 && year % 100 != 0));
  int[] mlen = isLeap ? LEAP : NORMAL;
  calc += mlen[month] * MILLISECONDS_PER_DAY;
  calc += (day - 1) * MILLISECONDS_PER_DAY;
  calc += millis;
  calc -= mRawOffset;
  calc -= UNIX_OFFSET;
  return getOffset(calc);
}

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

@Override
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) {
  // XXX This assumes Gregorian always; Calendar switches from
  // Julian to Gregorian in 1582.  What calendar system are the
  // arguments supposed to come from?
  long calc = (year / 400) * MILLISECONDS_PER_400_YEARS;
  year %= 400;
  calc += year * (365 * MILLISECONDS_PER_DAY);
  calc += ((year + 3) / 4) * MILLISECONDS_PER_DAY;
  if (year > 0) {
    calc -= ((year - 1) / 100) * MILLISECONDS_PER_DAY;
  }
  boolean isLeap = (year == 0 || (year % 4 == 0 && year % 100 != 0));
  int[] mlen = isLeap ? LEAP : NORMAL;
  calc += mlen[month] * MILLISECONDS_PER_DAY;
  calc += (day - 1) * MILLISECONDS_PER_DAY;
  calc += millis;
  calc -= mRawOffset;
  calc -= UNIX_OFFSET;
  return getOffset(calc);
}

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

@Override
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) {
  // XXX This assumes Gregorian always; Calendar switches from
  // Julian to Gregorian in 1582.  What calendar system are the
  // arguments supposed to come from?
  long calc = (year / 400) * MILLISECONDS_PER_400_YEARS;
  year %= 400;
  calc += year * (365 * MILLISECONDS_PER_DAY);
  calc += ((year + 3) / 4) * MILLISECONDS_PER_DAY;
  if (year > 0) {
    calc -= ((year - 1) / 100) * MILLISECONDS_PER_DAY;
  }
  boolean isLeap = (year == 0 || (year % 4 == 0 && year % 100 != 0));
  int[] mlen = isLeap ? LEAP : NORMAL;
  calc += mlen[month] * MILLISECONDS_PER_DAY;
  calc += (day - 1) * MILLISECONDS_PER_DAY;
  calc += millis;
  calc -= mRawOffset;
  calc -= UNIX_OFFSET;
  return getOffset(calc);
}

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

@Override
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) {
  // XXX This assumes Gregorian always; Calendar switches from
  // Julian to Gregorian in 1582.  What calendar system are the
  // arguments supposed to come from?
  long calc = (year / 400) * MILLISECONDS_PER_400_YEARS;
  year %= 400;
  calc += year * (365 * MILLISECONDS_PER_DAY);
  calc += ((year + 3) / 4) * MILLISECONDS_PER_DAY;
  if (year > 0) {
    calc -= ((year - 1) / 100) * MILLISECONDS_PER_DAY;
  }
  boolean isLeap = (year == 0 || (year % 4 == 0 && year % 100 != 0));
  int[] mlen = isLeap ? LEAP : NORMAL;
  calc += mlen[month] * MILLISECONDS_PER_DAY;
  calc += (day - 1) * MILLISECONDS_PER_DAY;
  calc += millis;
  calc -= mRawOffset;
  calc -= UNIX_OFFSET;
  return getOffset(calc);
}

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

@Override
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) {
  // XXX This assumes Gregorian always; Calendar switches from
  // Julian to Gregorian in 1582.  What calendar system are the
  // arguments supposed to come from?
  long calc = (year / 400) * MILLISECONDS_PER_400_YEARS;
  year %= 400;
  calc += year * (365 * MILLISECONDS_PER_DAY);
  calc += ((year + 3) / 4) * MILLISECONDS_PER_DAY;
  if (year > 0) {
    calc -= ((year - 1) / 100) * MILLISECONDS_PER_DAY;
  }
  boolean isLeap = (year == 0 || (year % 4 == 0 && year % 100 != 0));
  int[] mlen = isLeap ? LEAP : NORMAL;
  calc += mlen[month] * MILLISECONDS_PER_DAY;
  calc += (day - 1) * MILLISECONDS_PER_DAY;
  calc += millis;
  calc -= mRawOffset;
  calc -= UNIX_OFFSET;
  return getOffset(calc);
}

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

@Override
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) {
  // XXX This assumes Gregorian always; Calendar switches from
  // Julian to Gregorian in 1582.  What calendar system are the
  // arguments supposed to come from?
  long calc = (year / 400) * MILLISECONDS_PER_400_YEARS;
  year %= 400;
  calc += year * (365 * MILLISECONDS_PER_DAY);
  calc += ((year + 3) / 4) * MILLISECONDS_PER_DAY;
  if (year > 0) {
    calc -= ((year - 1) / 100) * MILLISECONDS_PER_DAY;
  }
  boolean isLeap = (year == 0 || (year % 4 == 0 && year % 100 != 0));
  int[] mlen = isLeap ? LEAP : NORMAL;
  calc += mlen[month] * MILLISECONDS_PER_DAY;
  calc += (day - 1) * MILLISECONDS_PER_DAY;
  calc += millis;
  calc -= mRawOffset;
  calc -= UNIX_OFFSET;
  return getOffset(calc);
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com