tango.time.Clock

License:
BSD style:

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).

static @property Time now();
Return the current time as UTC since the epoch

static DateTime toDate();
Set Date fields to represent the current time.

static DateTime toDate(const(Time) time);
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.

static Time fromDate(ref const(DateTime) dt);
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.

package static Time convert(ref const(timeval) tv);
Convert timeval to a Time

package static timeval convert(const(Time) time);
Convert Time to a timeval


Page generated by Ddoc. Copyright (c) 2007 Kris Bell. All rights reserved