undead.date

Deprecated. It will be removed in February 2012. Please use std.datetime instead.

Dates are represented in several formats. The date implementation revolves around a central type, d_time, from which other formats are converted to and from. Dates are calculated using the Gregorian calendar.

References: Gregorian calendar (Wikipedia)

Members

Aliases

DosFileTime
alias DosFileTime = uint

Type representing the DOS file date/time format.

TicksPerDay
deprecated alias TicksPerDay = ticksPerDay
Undocumented in source.
TicksPerHour
deprecated alias TicksPerHour = ticksPerHour
Undocumented in source.
TicksPerMinute
deprecated alias TicksPerMinute = ticksPerMinute
Undocumented in source.
TicksPerMs
deprecated alias TicksPerMs = ticksPerMs
Undocumented in source.
TicksPerSecond
deprecated alias TicksPerSecond = ticksPerSecond
Undocumented in source.
d_time
alias d_time = long

d_time is a signed arithmetic type giving the time elapsed since January 1, 1970. Negative values are for dates preceding 1970. The time unit used is Ticks. Ticks are milliseconds or smaller intervals.

toString
deprecated alias toString = UTCtoString

Alias for UTCtoString (deprecated).

Enums

hoursPerDay
anonymousenum hoursPerDay
Undocumented in source.

Functions

UTCtoLocalTime
d_time UTCtoLocalTime(d_time t)

Convert from UTC to local time.

UTCtoString
string UTCtoString(d_time time)

Converts UTC time into a text string of the form: "Www Mmm dd hh:mm:ss GMT+-TZ yyyy". For example, "Tue Apr 02 02:04:57 GMT-0800 1996". If time is invalid, i.e. is d_time_nan, the string "Invalid date" is returned.

benchmark
ulong[] benchmark(uint times, ulong[] result)

Benchmarks code for speed assessment and comparison.

d_time2FILETIME
FILETIME d_time2FILETIME(d_time dt)
Undocumented in source. Be warned that the author may not have intended to support it.
dateFromNthWeekdayOfMonth
int dateFromNthWeekdayOfMonth(int year, int month, int weekday, int n)

Determine the date in the month, 1..31, of the nth weekday.

dateFromTime
int dateFromTime(d_time t)

Compute which day in a month a d_time t is.

day
int day(d_time t)
Undocumented in source. Be warned that the author may not have intended to support it.
dayFromYear
int dayFromYear(int year)

Calculates the number of days elapsed since 1 January 1970 until 1 January of the given year.

daylightSavingTA
int daylightSavingTA(d_time dt)
Undocumented in source. Be warned that the author may not have intended to support it.
daylightSavingTA
int daylightSavingTA(d_time dt)
Undocumented in source. Be warned that the author may not have intended to support it.
daysInMonth
int daysInMonth(int year, int month)

Determine the number of days in a month, 1..31.

daysInYear
uint daysInYear(uint year)

Calculates the number of days that exists in a year.

dmod
int dmod(d_time n, d_time d)
Undocumented in source. Be warned that the author may not have intended to support it.
floor
d_time floor(d_time d, int divisor)
Undocumented in source. Be warned that the author may not have intended to support it.
getLocalTZA
d_time getLocalTZA()
Undocumented in source. Be warned that the author may not have intended to support it.
getLocalTZA
d_time getLocalTZA()
Undocumented in source. Be warned that the author may not have intended to support it.
getUTCtime
d_time getUTCtime()

Get current UTC time.

getUTCtime
d_time getUTCtime()

Get current UTC time.

hourFromTime
int hourFromTime(d_time time)

Calculates the hour from time.

inLeapYear
bool inLeapYear(d_time t)

Determines if d_time t is a leap year.

leapYear
bool leapYear(uint y)
Undocumented in source. Be warned that the author may not have intended to support it.
localTimetoUTC
d_time localTimetoUTC(d_time t)

Convert from local time to UTC.

makeDate
d_time makeDate(d_time day, d_time time)
Undocumented in source. Be warned that the author may not have intended to support it.
makeDay
d_time makeDay(d_time year, d_time month, d_time date)
Undocumented in source. Be warned that the author may not have intended to support it.
makeTime
d_time makeTime(d_time hour, d_time min, d_time sec, d_time ms)
Undocumented in source. Be warned that the author may not have intended to support it.
minFromTime
int minFromTime(d_time time)

Calculates the minute from time.

monthFromTime
int monthFromTime(d_time t)

Calculates the month from the d_time t.

msFromTime
int msFromTime(d_time time)

Calculates the milisecond from time.

parse
d_time parse(string s)

Parses s as a textual date string, and returns it as a d_time. If the string is not a valid date, d_time_nan is returned.

secFromTime
int secFromTime(d_time time)

Calculates the second from time.

std_date_static_this
void std_date_static_this()
Undocumented in source. Be warned that the author may not have intended to support it.
timeClip
d_time timeClip(d_time time)
Undocumented in source. Be warned that the author may not have intended to support it.
timeFromYear
d_time timeFromYear(int y)
Undocumented in source. Be warned that the author may not have intended to support it.
timeWithinDay
int timeWithinDay(d_time t)
Undocumented in source. Be warned that the author may not have intended to support it.
toDateString
string toDateString(d_time time)

Converts the date portion of time into a text string of the form: "Www Mmm dd yyyy", for example, "Tue Apr 02 1996". If time is invalid, "Invalid date" is returned.

toDosFileTime
DosFileTime toDosFileTime(d_time t)

Convert from d_time to DOS file date/time.

toDtime
d_time toDtime(DosFileTime time)

Convert from DOS file date/time to d_time.

toISO8601YearWeek
void toISO8601YearWeek(d_time t, int year, int week)

Compute year and week [1..53] from t. The ISO 8601 week 1 is the first week of the year that includes January 4. Monday is the first day of the week. References: ISO 8601 (Wikipedia)

toInteger
d_time toInteger(d_time n)
Undocumented in source. Be warned that the author may not have intended to support it.
toTimeString
string toTimeString(d_time time)

Converts the time portion of t into a text string of the form: "hh:mm:ss GMT+-TZ", for example, "02:04:57 GMT-0800". If t is invalid, "Invalid date" is returned. The input must be in UTC, and the output is in local time.

toUTCString
string toUTCString(d_time t)

Converts t into a text string of the form: "Www, dd Mmm yyyy hh:mm:ss UTC". If t is invalid, "Invalid date" is returned.

weekDay
int weekDay(d_time t)

Compute which day of the week a d_time t is.

yearFromTime
int yearFromTime(d_time t)

Calculates the year from the d_time t.

Static functions

FILETIME2d_time
d_time FILETIME2d_time(FILETIME* ft)
Undocumented in source. Be warned that the author may not have intended to support it.
SYSTEMTIME2d_time
d_time SYSTEMTIME2d_time(SYSTEMTIME* st, d_time t)
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

localTZA
d_time localTZA;
Undocumented in source.

Structs

Date
struct Date

Time broken down into its components.

Variables

d_time_nan
enum d_time d_time_nan;

A value for d_time that does not represent a valid time.

Meta

License

<a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.