Module: Toybox.Time.Gregorian
Overview
See Also:
Classes Under Namespace
Classes: Info
Constant Summary
-
DayOfWeek
-
Month
Constant Variables
Type | Name | Value | Since | Description |
---|---|---|---|---|
Type | SECONDS_PER_DAY | 86400 | API Level 1.0.0 |
The number of seconds in one day |
Type | SECONDS_PER_HOUR | 3600 | API Level 1.0.0 |
The number of seconds in one hour |
Type | SECONDS_PER_MINUTE | 60 | API Level 1.0.0 |
The number of seconds in one minute |
Type | SECONDS_PER_YEAR | 31557600 | API Level 1.0.0 |
The number of seconds in one year |
Name | Value | Since | Description | See Also |
---|---|---|---|---|
DAY_SUNDAY | 1 | API Level 3.0.0 |
Sunday |
|
DAY_MONDAY | 2 | API Level 3.0.0 |
Monday |
|
DAY_TUESDAY | 3 | API Level 3.0.0 |
Tuesday |
|
DAY_WEDNESDAY | 4 | API Level 3.0.0 |
Wednesday |
|
DAY_THURSDAY | 5 | API Level 3.0.0 |
Thursday |
|
DAY_FRIDAY | 6 | API Level 3.0.0 |
Friday |
|
DAY_SATURDAY | 7 | API Level 3.0.0 |
Saturday |
Name | Value | Since | Description | See Also |
---|---|---|---|---|
MONTH_JANUARY | 1 | API Level 3.0.0 |
January |
|
MONTH_FEBRUARY | 2 | API Level 3.0.0 |
February |
|
MONTH_MARCH | 3 | API Level 3.0.0 |
March |
|
MONTH_APRIL | 4 | API Level 3.0.0 |
April |
|
MONTH_MAY | 5 | API Level 3.0.0 |
May |
|
MONTH_JUNE | 6 | API Level 3.0.0 |
June |
|
MONTH_JULY | 7 | API Level 3.0.0 |
July |
|
MONTH_AUGUST | 8 | API Level 3.0.0 |
August |
|
MONTH_SEPTEMBER | 9 | API Level 3.0.0 |
September |
|
MONTH_OCTOBER | 10 | API Level 3.0.0 |
October |
|
MONTH_NOVEMBER | 11 | API Level 3.0.0 |
November |
|
MONTH_DECEMBER | 12 | API Level 3.0.0 |
December |
Instance Method Summary collapse
-
duration(options as { :years as Lang.Number, :days as Lang.Number, :hours as Lang.Number, :minutes as Lang.Number, :seconds as Lang.Number }) as Time.Duration
Create a Duration from a Dictionary of options.
- info(moment as Time.Moment or Time.LocalMoment, format as Time.DateFormat) as Gregorian.Info
-
localMoment(location as Position.Location, moment as Time.Moment) as Time.LocalMoment or Null
Create a LocalMoment from a Moment and a Location.
-
moment(options as { :year as Lang.Number, :month as Lang.Number or Lang.Symbol, :day as Lang.Number, :hour as Lang.Number, :minute as Lang.Number, :second as Lang.Number }) as Time.Moment
Create a Moment from a Dictionary of options.
- utcInfo(moment as Time.Moment, format as Time.DateFormat) as Gregorian.Info
Instance Method Details
duration(options as { :years as Lang.Number, :days as Lang.Number, :hours as Lang.Number, :minutes as Lang.Number, :seconds as Lang.Number }) as Time.Duration
Create a Duration from a Dictionary of options.
This is an alternative to Duration.initialize() that allows the Duration to be made more easily, using familiar units, which can be handy when building a Duration manually.
Option values are represented as signed 32-bit integers.
info(moment as Time.Moment or Time.LocalMoment, format as Time.DateFormat) as Gregorian.Info
localMoment(location as Position.Location, moment as Time.Moment) as Time.LocalMoment or Null
Create a LocalMoment from a Moment and a Location
moment(options as { :year as Lang.Number, :month as Lang.Number or Lang.Symbol, :day as Lang.Number, :hour as Lang.Number, :minute as Lang.Number, :second as Lang.Number }) as Time.Moment
Create a Moment from a Dictionary of options.
Each option value is assumed to be in the UTC time zone.
Unlike Moment.initialize(), which is based on the UNIX epoch, a Moment created with Gregorian.moment() is based on today(). The result is determined by taking the result of today() and overlaying the options provided.