Elektrine lite

← Feed

@devnull@mamot.fr

2024-07-28 14:56 UTC

@skaverat@skaverat.net There's no point storing dates in this format. Especially when there's just date, not time. For storing, there is ISO-8601 format. Unix epoch timestamp is useful to make calculations on dates much more easier, and faster AND with enough precision (second) than date calculations on human readable format. No extra code, no libraries, no extra-anything to handle months with 31 vs 30 vs 29 vs 28 as well all the different human readable formats, and all the crap… So much less error-prone

Replies (1)

  • @devnull@mamot.fr 2024-07-28 14:56

    @skaverat@skaverat.net You just grab a reference date, and the date you want (some file age, whatever…) stored ISO-8601, convert them to UNIX Epoch, make a substraction, and convert the result back to ISO-8601. (Or any other format, works just the same. But any other human-readable date format, than ISO-8601, sucks by design…)

    Open ##5398512