# datetime::DateTime

    sys::Obj
      sys::Virtual
        datetime::DateTime

`public class DateTime`

day

  `public byte day`

  Day of month (1-based). Only valid after successful fromNanos() call.

dayOfWeek

  `public byte dayOfWeek`

  Day of week (Sun = 0). Only valid after successful fromNanos() call.

daysPerMonth

  `public static const define byte[] daysPerMonth`

epochDayOfWeek

  `public static const define int epochDayOfWeek`

hour

  `public byte hour`

  Hour of day (0-23). Only valid after successful fromNanos() call.

invalid

  `public static const define long invalid`

minute

  `public byte minute`

  Minute of hour (0-59). Only valid after successful fromNanos() call.

month

  `public byte month`

  Month of year (1-based). Only valid after successful fromNanos() call.

nanosMax

  `public static const define long nanosMax`

nanosecond

  `public int nanosecond`

  Fractional seconds in nanoseconds (0 - 999,999)

       Only valid after successful fromNanos() call.

second

  `public byte second`

  Seconds of minute (0-59). Only valid after successful fromNanos() call.

utcOffset

  `public int utcOffset [unit="second"]`

  UTC offset in seconds. Used in to/from Nanos calculations.

year

  `public short year`

  Year (2000-2099). Only valid after successful fromNanos() call.

fromNanos

  `public int fromNanos(long nanos)`

  Initialize a DateTime given nanoseconds since epoch.

       Return -1 if parameters are out of range

isLeapYear

  `public static bool isLeapYear(int year)`

  Return true if given absolute year is a leap year

reset

  `public void reset()`

  Reset DateTime instance to default value of 1 Jan 2000 00:00:00

       with UTC offset of 0L

toNanos

  `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)