gpt4 book ai didi

org.joda.time.chrono.ZonedChronology类的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 00:02:49 25 4
gpt4 key购买 nike

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

ZonedChronology介绍

[英]Wraps another Chronology to add support for time zones.

ZonedChronology is thread-safe and immutable.
[中]包装另一个年表以添加对时区的支持。
ZonedChronology是线程安全且不可变的。

代码示例

代码示例来源:origin: joda-time/joda-time

public Chronology withZone(DateTimeZone zone) {
  if (zone == null) {
    zone = DateTimeZone.getDefault();
  }
  if (zone == getParam()) {
    return this;
  }
  if (zone == DateTimeZone.UTC) {
    return getBase();
  }
  return new ZonedChronology(getBase(), zone);
}

代码示例来源:origin: joda-time/joda-time

private DateTimeField convertField(DateTimeField field, HashMap<Object, Object> converted) {
  if (field == null || !field.isSupported()) {
    return field;
  }
  if (converted.containsKey(field)) {
    return (DateTimeField)converted.get(field);
  }
  ZonedDateTimeField zonedField =
    new ZonedDateTimeField(field, getZone(),
                convertField(field.getDurationField(), converted),
                convertField(field.getRangeDurationField(), converted),
                convertField(field.getLeapDurationField(), converted));
  converted.put(field, zonedField);
  return zonedField;
}

代码示例来源:origin: joda-time/joda-time

/**
 * Gets an instance of the ISOChronology in the given time zone.
 * 
 * @param zone  the time zone to get the chronology in, null is default
 * @return a chronology in the specified time zone
 */
public static ISOChronology getInstance(DateTimeZone zone) {
  if (zone == null) {
    zone = DateTimeZone.getDefault();
  }
  ISOChronology chrono = cCache.get(zone);
  if (chrono == null) {
    chrono = new ISOChronology(ZonedChronology.getInstance(INSTANCE_UTC, zone));
    ISOChronology oldChrono = cCache.putIfAbsent(zone, chrono);
    if (oldChrono != null) {
      chrono = oldChrono;
    }
  }
  return chrono;
}

代码示例来源:origin: joda-time/joda-time

public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth,
               int hourOfDay, int minuteOfHour,
               int secondOfMinute, int millisOfSecond)
  throws IllegalArgumentException
{
  return localToUTC(getBase().getDateTimeMillis
           (year, monthOfYear, dayOfMonth, 
            hourOfDay, minuteOfHour, secondOfMinute, millisOfSecond));
}

代码示例来源:origin: joda-time/joda-time

/**
 * A debugging string for the chronology.
 * 
 * @return the debugging string
 */
public String toString() {
  return "ZonedChronology[" + getBase() + ", " + getZone().getID() + ']';
}

代码示例来源:origin: joda-time/joda-time

public long getDateTimeMillis(long instant,
               int hourOfDay, int minuteOfHour,
               int secondOfMinute, int millisOfSecond)
  throws IllegalArgumentException
{
  return localToUTC(getBase().getDateTimeMillis
           (instant + getZone().getOffset(instant),
            hourOfDay, minuteOfHour, secondOfMinute, millisOfSecond));
}

代码示例来源:origin: joda-time/joda-time

ZonedDurationField(DurationField field, DateTimeZone zone) {
  super(field.getType());
  if (!field.isSupported()) {
    throw new IllegalArgumentException();
  }
  iField = field;
  iTimeField = useTimeArithmetic(field);
  iZone = zone;
}

代码示例来源:origin: joda-time/joda-time

/**
 * Create a ZonedChronology for any chronology, overriding any time zone it
 * may already have.
 *
 * @param base base chronology to wrap
 * @param zone the time zone
 * @throws IllegalArgumentException if chronology or time zone is null
 */
public static ZonedChronology getInstance(Chronology base, DateTimeZone zone) {
  if (base == null) {
    throw new IllegalArgumentException("Must supply a chronology");
  }
  base = base.withUTC();
  if (base == null) {
    throw new IllegalArgumentException("UTC chronology must not be null");
  }
  if (zone == null) {
    throw new IllegalArgumentException("DateTimeZone must not be null");
  }
  return new ZonedChronology(base, zone);
}

代码示例来源:origin: joda-time/joda-time

fields.eras = convertField(fields.eras, converted);
fields.centuries = convertField(fields.centuries, converted);
fields.years = convertField(fields.years, converted);
fields.months = convertField(fields.months, converted);
fields.weekyears = convertField(fields.weekyears, converted);
fields.weeks = convertField(fields.weeks, converted);
fields.days = convertField(fields.days, converted);
fields.halfdays = convertField(fields.halfdays, converted);
fields.hours = convertField(fields.hours, converted);
fields.minutes = convertField(fields.minutes, converted);
fields.seconds = convertField(fields.seconds, converted);
fields.millis = convertField(fields.millis, converted);
fields.year = convertField(fields.year, converted);
fields.yearOfEra = convertField(fields.yearOfEra, converted);
fields.yearOfCentury = convertField(fields.yearOfCentury, converted);
fields.centuryOfEra = convertField(fields.centuryOfEra, converted);
fields.era = convertField(fields.era, converted);
fields.dayOfWeek = convertField(fields.dayOfWeek, converted);
fields.dayOfMonth = convertField(fields.dayOfMonth, converted);
fields.dayOfYear = convertField(fields.dayOfYear, converted);
fields.monthOfYear = convertField(fields.monthOfYear, converted);
fields.weekOfWeekyear = convertField(fields.weekOfWeekyear, converted);
fields.weekyear = convertField(fields.weekyear, converted);
fields.weekyearOfCentury = convertField(fields.weekyearOfCentury, converted);
fields.millisOfSecond = convertField(fields.millisOfSecond, converted);
fields.millisOfDay = convertField(fields.millisOfDay, converted);

代码示例来源:origin: joda-time/joda-time

public DateTimeZone getZone() {
  return (DateTimeZone)getParam();
}

代码示例来源:origin: joda-time/joda-time

private DurationField convertField(DurationField field, HashMap<Object, Object> converted) {
  if (field == null || !field.isSupported()) {
    return field;
  }
  if (converted.containsKey(field)) {
    return (DurationField)converted.get(field);
  }
  ZonedDurationField zonedField = new ZonedDurationField(field, getZone());
  converted.put(field, zonedField);
  return zonedField;
}

代码示例来源:origin: joda-time/joda-time

public Chronology withUTC() {
  return getBase();
}

代码示例来源:origin: JodaOrg/joda-time

public long getDateTimeMillis(long instant,
               int hourOfDay, int minuteOfHour,
               int secondOfMinute, int millisOfSecond)
  throws IllegalArgumentException
{
  return localToUTC(getBase().getDateTimeMillis
           (instant + getZone().getOffset(instant),
            hourOfDay, minuteOfHour, secondOfMinute, millisOfSecond));
}

代码示例来源:origin: JodaOrg/joda-time

/**
 * A debugging string for the chronology.
 * 
 * @return the debugging string
 */
public String toString() {
  return "ZonedChronology[" + getBase() + ", " + getZone().getID() + ']';
}

代码示例来源:origin: JodaOrg/joda-time

public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth,
               int hourOfDay, int minuteOfHour,
               int secondOfMinute, int millisOfSecond)
  throws IllegalArgumentException
{
  return localToUTC(getBase().getDateTimeMillis
           (year, monthOfYear, dayOfMonth, 
            hourOfDay, minuteOfHour, secondOfMinute, millisOfSecond));
}

代码示例来源:origin: JodaOrg/joda-time

ZonedDurationField(DurationField field, DateTimeZone zone) {
  super(field.getType());
  if (!field.isSupported()) {
    throw new IllegalArgumentException();
  }
  iField = field;
  iTimeField = useTimeArithmetic(field);
  iZone = zone;
}

代码示例来源:origin: JodaOrg/joda-time

/**
 * Create a ZonedChronology for any chronology, overriding any time zone it
 * may already have.
 *
 * @param base base chronology to wrap
 * @param zone the time zone
 * @throws IllegalArgumentException if chronology or time zone is null
 */
public static ZonedChronology getInstance(Chronology base, DateTimeZone zone) {
  if (base == null) {
    throw new IllegalArgumentException("Must supply a chronology");
  }
  base = base.withUTC();
  if (base == null) {
    throw new IllegalArgumentException("UTC chronology must not be null");
  }
  if (zone == null) {
    throw new IllegalArgumentException("DateTimeZone must not be null");
  }
  return new ZonedChronology(base, zone);
}

代码示例来源:origin: JodaOrg/joda-time

fields.eras = convertField(fields.eras, converted);
fields.centuries = convertField(fields.centuries, converted);
fields.years = convertField(fields.years, converted);
fields.months = convertField(fields.months, converted);
fields.weekyears = convertField(fields.weekyears, converted);
fields.weeks = convertField(fields.weeks, converted);
fields.days = convertField(fields.days, converted);
fields.halfdays = convertField(fields.halfdays, converted);
fields.hours = convertField(fields.hours, converted);
fields.minutes = convertField(fields.minutes, converted);
fields.seconds = convertField(fields.seconds, converted);
fields.millis = convertField(fields.millis, converted);
fields.year = convertField(fields.year, converted);
fields.yearOfEra = convertField(fields.yearOfEra, converted);
fields.yearOfCentury = convertField(fields.yearOfCentury, converted);
fields.centuryOfEra = convertField(fields.centuryOfEra, converted);
fields.era = convertField(fields.era, converted);
fields.dayOfWeek = convertField(fields.dayOfWeek, converted);
fields.dayOfMonth = convertField(fields.dayOfMonth, converted);
fields.dayOfYear = convertField(fields.dayOfYear, converted);
fields.monthOfYear = convertField(fields.monthOfYear, converted);
fields.weekOfWeekyear = convertField(fields.weekOfWeekyear, converted);
fields.weekyear = convertField(fields.weekyear, converted);
fields.weekyearOfCentury = convertField(fields.weekyearOfCentury, converted);
fields.millisOfSecond = convertField(fields.millisOfSecond, converted);
fields.millisOfDay = convertField(fields.millisOfDay, converted);

代码示例来源:origin: JodaOrg/joda-time

public DateTimeZone getZone() {
  return (DateTimeZone)getParam();
}

代码示例来源:origin: JodaOrg/joda-time

private DurationField convertField(DurationField field, HashMap<Object, Object> converted) {
  if (field == null || !field.isSupported()) {
    return field;
  }
  if (converted.containsKey(field)) {
    return (DurationField)converted.get(field);
  }
  ZonedDurationField zonedField = new ZonedDurationField(field, getZone());
  converted.put(field, zonedField);
  return zonedField;
}

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