Linux-kernel mailing list archive 2000-02,: Re: time_t size: The year 2038 bug Summary:

# Re: time_t size: The year 2038 bug Summary:

James Manning (jmm@raleigh.ibm.com)
Tue, 11 Jan 2000 20:08:31 -0500

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Keith Owens: "Re: time_t size: The year 2038 bug Summary:"
- Previous message: Keith Owens: "Re: OOPS with slab cache"

[ Tuesday, January 11, 2000 ] Lauri Tischler wrote:
> BTW. What is the _exact_ datetime when Unix's freak ?

Short answer: Tue Jan 19 03:14:07 2038 (UTC/GMT)

When the signed int of 32 bits (2's complement) wraps from INT_MAX to
INT_MIN by incrementing

jmm@jmm:/home/jmm> export TZ=UTC
jmm@jmm:/home/jmm> perl -le 'print scalar localtime 2**31-1'
Tue Jan 19 03:14:07 2038
jmm@jmm:/home/jmm> perl -le 'print scalar localtime 2**31'
Fri Dec 13 20:45:52 1901

And just for trivia:

jmm@jmm:/home/jmm> perl -le 'print scalar localtime 0'
Thu Jan 1 00:00:00 1970

James

    --
    Miscellaneous Engineer --- IBM Netfinity Performance Development

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/

- Next message: Keith Owens: "Re: time_t size: The year 2038 bug Summary:"
- Previous message: Keith Owens: "Re: OOPS with slab cache"