The OpenD Programming Language

DosFileTimeToSysTime

Converts from DOS file date/time to SysTime.

@safe
DosFileTimeToSysTime
(,
immutable TimeZone tz = LocalTime()
)

Parameters

dft DosFileTime

The DOS file time to convert.

tz TimeZone

The time zone which the DOS file time is assumed to be in.

Throws

std.datetime.date.DateTimeException if the DosFileTime is invalid.

Examples

import std.datetime.date : DateTime;

assert(DosFileTimeToSysTime(0b00000000001000010000000000000000) == SysTime(DateTime(1980, 1, 1, 0, 0, 0)));
assert(DosFileTimeToSysTime(0b11111111100111111011111101111101) == SysTime(DateTime(2107, 12, 31, 23, 59, 58)));
assert(DosFileTimeToSysTime(0x3E3F8456) == SysTime(DateTime(2011, 1, 31, 16, 34, 44)));

Meta