Class: Toybox.Time.LocalMoment
- Inherits:
-
Toybox.Lang.Object
Overview
A LocalMoment is an immutable moment in time.
LocalMoment represents a single point in time at a specific location. It differs from Moment in that it also keeps time zone information in addition to the time.
Instance Method Summary collapse
-
add(addend as Time.Duration) as Time.LocalMoment
Add a Duration to a LocalMoment.
-
compare(moment as Time.LocalMoment) as Lang.Number
Determine if a LocalMoment is before or after another LocalMoment This computes a Number representing the difference between the two LocalMoment objects in seconds.
-
getDaylightSavingsTimeOffset() as Lang.Number
Get the daylight saving time offset from UTC time in seconds.
-
getOffset() as Lang.Number
Get the total time offset from UTC time in seconds.
-
getTimeZoneOffset() as Lang.Number
Get the time zone offset from UTC time in seconds.
-
greaterThan(moment as Time.LocalMoment) as Lang.Boolean
Determine if a LocalMoment is greater than another LocalMoment.
-
isDaylightSavingsTime() as Lang.Boolean
Get whether the daylight saving time offset is in effect.
-
lessThan(moment as Time.LocalMoment) as Lang.Boolean
Determine if a LocalMoment is less than another LocalMoment.
-
subtract(subtrahend as Time.Duration or Time.LocalMoment) as Time.Duration or Time.LocalMoment
Subtract a Duration or LocalMoment from a LocalMoment.
-
toMoment() as Time.Moment
Get a Moment for this.
-
value() as Lang.Number
Get the UTC value of a LocalMoment.
Instance Method Details
add(addend as Time.Duration) as Time.LocalMoment
Add a Duration to a LocalMoment.
compare(moment as Time.LocalMoment) as Lang.Number
Determine if a LocalMoment is before or after another LocalMoment
This computes a Number representing the difference between the two LocalMoment objects in seconds. The subtract() method can also be used to get the absolute Duration between two LocalMoment objects.
getDaylightSavingsTimeOffset() as Lang.Number
Get the daylight saving time offset from UTC time in seconds.
getOffset() as Lang.Number
Get the total time offset from UTC time in seconds
getTimeZoneOffset() as Lang.Number
Get the time zone offset from UTC time in seconds.
This is the time zone offset without the daylight saving time offset.
greaterThan(moment as Time.LocalMoment) as Lang.Boolean
Determine if a LocalMoment is greater than another LocalMoment.
isDaylightSavingsTime() as Lang.Boolean
Get whether the daylight saving time offset is in effect
lessThan(moment as Time.LocalMoment) as Lang.Boolean
Determine if a LocalMoment is less than another LocalMoment.
subtract(subtrahend as Time.Duration or Time.LocalMoment) as Time.Duration or Time.LocalMoment
Subtract a Duration or LocalMoment from a LocalMoment.
toMoment() as Time.Moment
Get a Moment for this.
value() as Lang.Number
Get the UTC value of a LocalMoment.