Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As per gakman's comment in the Google+ crosspost[1], be wary of the Unix millenium bug[2] if you use integers for timestamp storage.

[1] https://plus.google.com/106356964679457436995/posts/Hzq2P7V6... [2] http://en.wikipedia.org/wiki/Year_2038_problem



"But there's no way my code will be running unchanged in 2038!"


I wonder about storing the timestamp in a varchar field of sufficient size to avoid all of these headaches? Although I guess 64 bit will suffice for a very long time.


As a point of reference, the universe is estimated at less than 2^59 seconds old.


man 3p time suggests using time_t to "ease the eventual fix".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: