Time from timestamp?
Rikki Cattermole via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Jan 30 15:12:08 PST 2015
On 31/01/2015 12:06 p.m., ketmar wrote:
> On Fri, 30 Jan 2015 22:38:20 +0000, Chris Williams wrote:
>
>> Unix timestamps can be negative
> WUT?! O_O
Looks like we are both thinking the usual case.
The standard Unix time_t (data type representing a point in time) is a
signed integer data type, traditionally of 32 bits (but see below),
directly encoding the Unix time number as described in the preceding
section. Being 32 bits means that it covers a range of about 136 years
in total. The minimum representable time is 1901-12-13, and the maximum
representable time is 2038-01-19. The second after 03:14:07 UTC
2038-01-19 this representation overflows. This milestone is anticipated
with a mixture of amusement and dread; see year 2038 problem.
From wikipedia.
https://github.com/D-Programming-Language/druntime/blob/master/src/core/stdc/time.d#L68
Looks like I got to modify it.
More information about the Digitalmars-d-learn
mailing list