/** * Constructs an instance set to the local time defined by the specified * instant evaluated using ISO chronology in the default zone. * <p> * Once the constructor is completed, the zone is no longer used. * * @param instant the milliseconds from 1970-01-01T00:00:00Z */ public LocalDateTime(long instant) { this(instant, ISOChronology.getInstance()); }
private static ISOChronology fromTimezone(ZoneId timezone) { if (timezone == UTC) { return ISOChronology.getInstanceUTC(); } else { return ISOChronology.getInstance(DateTimeZone.forTimeZone(TimeZone.getTimeZone(timezone))); // <-- Jesus Christ, Java... } }
/** * Constructs an instance set to the milliseconds from 1970-01-01T00:00:00Z * using <code>ISOChronology</code> in the default time zone. * * @param instant the milliseconds from 1970-01-01T00:00:00Z */ public BaseDateTime(long instant) { this(instant, ISOChronology.getInstance()); }
/** * Constructs an instance set to the local time defined by the specified * instant evaluated using ISO chronology in the default zone. * <p> * Once the constructor is completed, the zone is no longer used. * * @param instant the milliseconds from 1970-01-01T00:00:00Z */ public LocalTime(long instant) { this(instant, ISOChronology.getInstance()); }
/** * Constructs an instance set to the local time defined by the specified * instant evaluated using ISO chronology in the default zone. * <p> * Once the constructor is completed, the zone is no longer used. * * @param instant the milliseconds from 1970-01-01T00:00:00Z */ public LocalDate(long instant) { this(instant, ISOChronology.getInstance()); }
/** * Constructs an instance set to the milliseconds from 1970-01-01T00:00:00Z * using <code>ISOChronology</code> in the specified time zone. * <p> * If the specified time zone is null, the default zone is used. * * @param instant the milliseconds from 1970-01-01T00:00:00Z * @param zone the time zone, null means default zone */ public BaseDateTime(long instant, DateTimeZone zone) { this(instant, ISOChronology.getInstance(zone)); }
/** * Constructs an instance set to the local time defined by the specified * instant evaluated using ISO chronology in the specified zone. * <p> * If the specified time zone is null, the default zone is used. * Once the constructor is completed, the zone is no longer used. * * @param instant the milliseconds from 1970-01-01T00:00:00Z * @param zone the time zone, null means default zone */ public LocalDate(long instant, DateTimeZone zone) { this(instant, ISOChronology.getInstance(zone)); }
/** * Constructs an instance set to the current system millisecond time * using <code>ISOChronology</code> in the default time zone. */ public BaseDateTime() { this(DateTimeUtils.currentTimeMillis(), ISOChronology.getInstance()); }
/** * Gets an instance of the ISOChronology in the default time zone. * * @return a chronology in the default time zone */ public static ISOChronology getInstance() { return getInstance(DateTimeZone.getDefault()); }
/** * Constructs an instance set to the current local time evaluated using * ISO chronology in the default zone. * <p> * Once the constructor is completed, the zone is no longer used. * * @see #now() */ public LocalDate() { this(DateTimeUtils.currentTimeMillis(), ISOChronology.getInstance()); }
/** * Constructs an instance set to the current local time evaluated using * ISO chronology in the default zone. * <p> * Once the constructor is completed, the zone is no longer used. * * @see #now() */ public LocalDateTime() { this(DateTimeUtils.currentTimeMillis(), ISOChronology.getInstance()); }
/** * Constructs an instance set to the current local time evaluated using * ISO chronology in the default zone. * <p> * Once the constructor is completed, the zone is no longer used. * * @see #now() */ public LocalTime() { this(DateTimeUtils.currentTimeMillis(), ISOChronology.getInstance()); }
/** * Constructs an instance set to the current system millisecond time * using <code>ISOChronology</code> in the specified time zone. * <p> * If the specified time zone is null, the default zone is used. * * @param zone the time zone, null means default zone */ public BaseDateTime(DateTimeZone zone) { this(DateTimeUtils.currentTimeMillis(), ISOChronology.getInstance(zone)); }
/** * Constructs an instance set to the current local time evaluated using * ISO chronology in the specified zone. * <p> * If the specified time zone is null, the default zone is used. * Once the constructor is completed, the zone is no longer used. * * @param zone the time zone, null means default zone * @see #now(DateTimeZone) */ public LocalDateTime(DateTimeZone zone) { this(DateTimeUtils.currentTimeMillis(), ISOChronology.getInstance(zone)); }
/** * Constructs an instance set to the current local time evaluated using * ISO chronology in the specified zone. * <p> * If the specified time zone is null, the default zone is used. * Once the constructor is completed, the zone is no longer used. * * @param zone the time zone, null means default zone * @see #now(DateTimeZone) */ public LocalTime(DateTimeZone zone) { this(DateTimeUtils.currentTimeMillis(), ISOChronology.getInstance(zone)); }
/** * Get this object as a DateTime using ISOChronology in the same zone. * * @return a DateTime using the same millis with ISOChronology */ public DateTime toDateTimeISO() { return new DateTime(getMillis(), ISOChronology.getInstance(getZone())); }
/** * Get this object as a DateTime using ISOChronology in the default zone, * returning <code>this</code> if possible. * * @return a DateTime using the same millis */ public DateTime toDateTimeISO() { if (getChronology() == ISOChronology.getInstance()) { return this; } return super.toDateTimeISO(); }
public TimestampShiftExpr(final List<Expr> args) { final PeriodGranularity granularity = getGranularity(args, ExprUtils.nilBindings()); arg = args.get(0); period = granularity.getPeriod(); chronology = ISOChronology.getInstance(granularity.getTimeZone()); step = getStep(args, ExprUtils.nilBindings()); }
/** * Get this object as a MutableDateTime using ISOChronology in the same zone. * * @return a MutableDateTime using the same millis with ISOChronology */ public MutableDateTime toMutableDateTimeISO() { return new MutableDateTime(getMillis(), ISOChronology.getInstance(getZone())); }
@Nonnull @Override public ExprEval eval(final ObjectBinding bindings) { final PeriodGranularity granularity = getGranularity(args, bindings); final Period period = granularity.getPeriod(); final Chronology chronology = ISOChronology.getInstance(granularity.getTimeZone()); final int step = getStep(args, bindings); return ExprEval.of(chronology.add(period, args.get(0).eval(bindings).asLong(), step)); }