HawkEye

HawkEye

192k Downloads

SQL Timestamps.

AltyFox opened this issue ยท 5 comments

commented

Currently, SQL entries are being stored as text in the format:
YYYY-MM-DD HH:MM:SS

Theoretically it would be better if times were stored as unix timestamps, then converted for display in all related utilities. It would allow for better localization formatting for other things, and would also make time diff calculation far easier.

commented

Whilst it would be better, converting a database of 20 million entries would take absolutely ages

commented

You are correct, it would. (BTW, how are you even determine record ages with the current timestamp scheme. o_o)

commented

That is a standard timestamp accepted by many languages. MySQL itself uses it. Most languages can just read the format off the same as reading UNIX time.

commented

Ah, I've never used it. I will always prefer UNIX timestamps. :)

commented

There isn't much of a difference except as you said - localization is easier. In a query you can still do SELECT * FROM database WHERE date < '2011-08-20 11:28:00'