DEV Community

Discussion on: Do you prefer unix epoch (a number) or ISO 8601 (a string) for timestamps?

Collapse
 
nektro profile image
Meghan (she/her) • Edited

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.

Collapse
 
tobiassn profile image
Tobias SN

Actually iirc, Unix time is 64 bits, not bytes. That means it’s only 8 bytes.

Collapse
 
nektro profile image
Meghan (she/her)

Yep. My mistake.