Class ClockExtensions
Inheritance
ClockExtensions
Assembly: NodaTime.dll
Syntax
public static class ClockExtensions
Methods
InBclSystemDefaultZone(IClock)
Constructs a
ZonedClock from a clock (the target of the method), in the wrapper for the
BCL system default time zone time zone and the ISO calendar system.
Declaration
public static ZonedClock InBclSystemDefaultZone(this IClock clock)
Parameters
Type |
Name |
Description |
IClock |
clock |
Clock to use in the returned object. |
Returns
Type |
Description |
ZonedClock |
A ZonedClock in the system default time zone and the ISO calendar system,
using the system clock. (The value returned is never null.) |
Exceptions
See Also
InTzdbSystemDefaultZone(IClock)
Constructs a
ZonedClock from a clock (the target of the method),
in the TZDB mapping for the system default time zone time zone and the ISO calendar system.
Declaration
public static ZonedClock InTzdbSystemDefaultZone(this IClock clock)
Parameters
Type |
Name |
Description |
IClock |
clock |
Clock to use in the returned object. |
Returns
Type |
Description |
ZonedClock |
A ZonedClock in the system default time zone (using TZDB) and the ISO calendar system,
using the system clock. (The value returned is never null.) |
Exceptions
See Also
InUtc(IClock)
Constructs a
ZonedClock from a clock (the target of the method),
using the UTC time zone and ISO calendar system.
Declaration
public static ZonedClock InUtc(this IClock clock)
Parameters
Type |
Name |
Description |
IClock |
clock |
Clock to use in the returned object. |
Returns
Type |
Description |
ZonedClock |
A ZonedClock with the given clock, in the UTC time zone and ISO calendar system. (The value returned is never null.) |
Exceptions
InZone(IClock, DateTimeZone)
Constructs a
ZonedClock from a clock (the target of the method),
and a time zone.
Declaration
public static ZonedClock InZone(this IClock clock, DateTimeZone zone)
Parameters
Type |
Name |
Description |
IClock |
clock |
Clock to use in the returned object. |
DateTimeZone |
zone |
Time zone to use in the returned object. |
Returns
Type |
Description |
ZonedClock |
A ZonedClock with the given clock and time zone, in the ISO calendar system. (The value returned is never null.) |
Exceptions
InZone(IClock, DateTimeZone, CalendarSystem)
Constructs a
ZonedClock from a clock (the target of the method),
a time zone, and a calendar system.
Declaration
public static ZonedClock InZone(this IClock clock, DateTimeZone zone, CalendarSystem calendar)
Parameters
Type |
Name |
Description |
IClock |
clock |
Clock to use in the returned object. |
DateTimeZone |
zone |
Time zone to use in the returned object. |
CalendarSystem |
calendar |
Calendar to use in the returned object. |
Returns
Type |
Description |
ZonedClock |
A ZonedClock with the given clock, time zone and calendar system. (The value returned is never null.) |
Exceptions