tango.time.Clock

License:

BSD style: see license.txt

Version:

Feb 2007: Initial release

Author:

Kris
struct Clock
Exposes UTC time relative to Jan 1st, 1 AD. These values are based upon a clock-tick of 100ns, giving them a span of greater than 10,000 years. These units of time are the foundation of most time and date functionality in Tango.
Interval is another type of time period, used for measuring a much shorter duration; typically used for timeout periods and for high-resolution timers. These intervals are measured in units of 1 second, and support fractional units (0.001 = 1ms).
Time now() [@property, static]
Return the current time as UTC since the epoch
DateTime toDate() [static]
Set Date fields to represent the current time.
DateTime toDate(const(Time) time) [static]
Set fields to represent the provided UTC time. Note that the conversion is limited by the underlying OS, and will fail to operate correctly with Time values beyond the domain. On Win32 the earliest representable date is 1601. On linux it is 1970. Both systems have limitations upon future dates also. Date is limited to millisecond accuracy at best.
Time fromDate(ref const(DateTime) dt) [static]
Convert Date fields to Time
Note that the conversion is limited by the underlying OS, and will not operate correctly with Time values beyond the domain. On Win32 the earliest representable date is 1601. On linux it is 1970. Both systems have limitations upon future dates also. Date is limited to millisecond accuracy at best.
Time convert(ref const(timeval) tv) [package, static]
Convert timeval to a Time
timeval convert(const(Time) time) [package, static]
Convert Time to a timeval