fiah, (edited )
@fiah@discuss.tchncs.de avatar

But, you totally can? When you store all your dates as an ISO 8601 string (UTC, so with Z at the end), you can simply compare the strings themselves with no further complications, if the strings match, the dates match, if one string is less than the other, the date therein is before the other. Their lexical order is equal to their chronological order

I agree that it’s a massive and unnecessary overhead that you should definitely avoid if possible, but for anything where this overhead is negligible it’s a very viable and safe way of storing date and time

edit: I forgot, there’s also a format that’s output by functions like toUTCstring that’s totally different and doesn’t have any logical order, but I honestly forgot about that format because nobody in their right mind would use it

  • All
  • Subscribed
  • Moderated
  • Favorites
  • todayilearned@lemmy.ml
  • DreamBathrooms
  • magazineikmin
  • cubers
  • InstantRegret
  • cisconetworking
  • Youngstown
  • vwfavf
  • slotface
  • Durango
  • rosin
  • everett
  • kavyap
  • thenastyranch
  • mdbf
  • megavids
  • khanakhh
  • modclub
  • tester
  • ethstaker
  • osvaldo12
  • GTA5RPClips
  • ngwrru68w68
  • Leos
  • anitta
  • tacticalgear
  • normalnudes
  • provamag3
  • JUstTest
  • All magazines