In reality I always use a string. And always in the format YYYY-MM-DD with the optional addition of hh:mm:ss. This means a full date-time is only 19 bytes instead of 32 or 64 since 95% of the time I don't need the millisecond accuracy of epoch time.
YYYY-MM-DD
hh:mm:ss
Actually iirc, Unix time is 64 bits, not bytes. That means it’s only 8 bytes.
Yep. My mistake.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
In reality I always use a string. And always in the format
YYYY-MM-DD
with the optional addition ofhh:mm:ss
. This means a full date-time is only 19 bytes instead of 32 or 64 since 95% of the time I don't need the millisecond accuracy of epoch time.Actually iirc, Unix time is 64 bits, not bytes. That means it’s only 8 bytes.
Yep. My mistake.