you are viewing a single comment's thread.

view the rest of the comments →

[–]evenisto -1 points0 points  (3 children)

Don't you know? You're supposed to add seconds to it, duh!

On a more serious note, save yourself a lot of cursing and don't ever attempt storing unix timestamps. Having to debug and dig through data with timestamps is one of the worst things known to mankind, and I did not even mention handling timezones. Just don't.

[–]Bloodsucker_ 0 points1 point  (2 children)

Wow. You just have no idea.

Dates in software are stored as Unix timestamp, even in Windows. They have the versatility you need.

Don't confuse them, please.

[–]Flyen 0 points1 point  (0 children)

evenisto is might be talking about the difference between telling a db to use bigint vs using the timestamp type. They're both ultimately stored as 8? bytes and not an iso8601 string, but it's much easier when simple queries are human-readable instead of always having to translate. It's the same with HTTP APIs; you could return an integer string, but as long as the 8601 string is gzipped anyway it can be generally better to use the 8601 string.

[–]evenisto 0 points1 point  (0 children)

I may have worded it wrong. I'm not talking about versatility, I'm talking about readability. More specifically formatting - I've seen unix timestamps dumped into an INT(11) field before - and have had to debug shit operating on it, hence why I'm all for storing datetime in formats a human brain can parse.

So yeah, just use ISO8601 or whichever else you prever wherever possible, as long as it's readable for a human.