sys::Obj sys::Virtual datetime::DateTime
public class DateTime
public byte day
Day of month (1-based). Only valid after successful fromNanos() call.
public byte dayOfWeek
Day of week (Sun = 0). Only valid after successful fromNanos() call.
public static const define byte[] daysPerMonth
public static const define int epochDayOfWeek
public byte hour
Hour of day (0-23). Only valid after successful fromNanos() call.
public static const define long invalid
public byte minute
Minute of hour (0-59). Only valid after successful fromNanos() call.
public byte month
Month of year (1-based). Only valid after successful fromNanos() call.
public static const define long nanosMax
public int nanosecond
Fractional seconds in nanoseconds (0 - 999,999)
Only valid after successful fromNanos() call.
public byte second
Seconds of minute (0-59). Only valid after successful fromNanos() call.
public int utcOffset [unit="second"]
UTC offset in seconds. Used in to/from Nanos calculations.
public short year
Year (2000-2099). Only valid after successful fromNanos() call.
public int fromNanos(long nanos)
Initialize a DateTime given nanoseconds since epoch.
Return -1 if parameters are out of range
public static bool isLeapYear(int year)
Return true if given absolute year is a leap year
public void reset()
Reset DateTime instance to default value of 1 Jan 2000 00:00:00
with UTC offset of 0L
public long toNanos()
Convert a local time to nanos since the Sedona epoch of 1 Jan 2000
Returns DateTime.invalid if any parameters are out of range
Year must be between 2000 and 2099 Month is 1 based, 1-12 day is 1-based hour must be 0-23 min, sec are 0-59 ns represents fraction seconds, must be <= 999,999,999 utcOffset represents the local time offset (in seconds) from UTC, including daylight savings time adjustment (if any)