Two times are equal if have identical hour, min, sec, and ns values.
Return hash of hour, min, sec, and ns values.
Get the hour of the time as a number between 0 and 23.
Return if "00:00:00" which is equal to defVal.
Get the minutes of the time as a number between 0 and 59.
Get the number of nanoseconds (the fraction of seconds) as a number between 0 and 999,999,999.
Get the whole seconds of the time as a number between 0 and 59.
Get this Time as a Fantom expression suitable for code generation.
Return the duration of time which has elapsed since midnight. See fromDuration.
Example:
Time(2, 30).toDuration => 150min
Get an immutable representation of this instance or throw NotImmutableErr if this object cannot be represented as an immutable:
Format this date according to the specified pattern. If pattern is null, then a localized default is used. The pattern format is the same as DateTime.toLocale:
h One digit 24 hour (0-23) 3, 22
hh Two digit 24 hour (0-23) 03, 22
k One digit 12 hour (1-12) 3, 11
kk Two digit 12 hour (1-12) 03, 11
m One digit minutes (0-59) 4, 45
mm Two digit minutes (0-59) 04, 45
s One digit seconds (0-59) 4, 45
ss Two digit seconds (0-59) 04, 45
SS Optional seconds (only if non-zero)
f* Fractional secs trailing zeros
F* Fractional secs no trailing zeros
a Lower case a/p for am/pm a, p
aa Lower case am/pm am, pm
A Upper case A/P for am/pm A, P
AA Upper case AM/PM AM, PM
'xyz' Literal characters
A symbol immediately preceding a "F" pattern with no fraction to print is skipped.
Optional
pattern: stringOptional
locale: LocaleTrap a dynamic call for handling. Dynamic calls are invoked with the -> shortcut operator:
a->x a.trap("x", null)
a->x() a.trap("x", null)
a->x = b a.trap("x", [b])
a->x(b) a.trap("x", [b])
a->x(b, c) a.trap("x", [b, c])
The default implementation provided by Obj attempts to use reflection. If name maps to a method, it is invoked with the specified arguments. If name maps to a field and args.size is zero, get the field. If name maps to a field and args.size is one, set the field and return args[0]. Otherwise throw UnknownSlotErr.
This method called whenever an it-block is applied to an
object. The default implementation calls the function with this
,
and then returns this
.
Static
defDefault value is "00:00:00".
Static
echoWrite x.toStr
to standard output followed by newline. If x
is null then print "null". If no argument is provided then
print an empty line.
Optional
x: JsObjStatic
fromTranslate a duration of time which has elapsed since midnight into a Time of day. See toDuration. If the duration is not between 0 and 24hr throw ArgErr.
Example:
Time.fromDuration(150min) => 02:30:00
Static
fromStatic
fromStatic
fromStatic
makeMake for the specified time values:
Throw ArgErr if any of the parameters are out of range.
Optional
sec: numberOptional
ns: numberStatic
nowGet the current time using the specified timezone. This method may use DateTime.now with the default tolerance 250ms.
Optional
tz: TimeZone
Time represents a time of day independent of a specific date or timezone.