Whenever possible I "shift right" and return a unix timestamp. If I have to read something in I try to understand the context and document that context, and turn it into a unix timestamp.
Mostly I'm not operating at the application / presentation layers.
This does cause friction when taking things at "interface value" (Sherry Turckle): just like everybody (I'm sure) I `grep -E '^2022-10-09'` or `grep -E '^Oct 09'` (looking at YOU, journalctl!). But I can also `perl -ne 'BEGIN { use Time::Local; $TIME = timelocal(0,0,5,7,8,122); } $t = (split /\s+/)[0]; $t > $TIME && $t < ($TIME + 60) && print;'`.
I have a little python script which does pretty much the same thing, with some attempts to recognize and fill in for rando date patterns just to make it a bit more universal.
I would counsel against storing human readable dates in databases and use unix time.
Mostly I'm not operating at the application / presentation layers.
This does cause friction when taking things at "interface value" (Sherry Turckle): just like everybody (I'm sure) I `grep -E '^2022-10-09'` or `grep -E '^Oct 09'` (looking at YOU, journalctl!). But I can also `perl -ne 'BEGIN { use Time::Local; $TIME = timelocal(0,0,5,7,8,122); } $t = (split /\s+/)[0]; $t > $TIME && $t < ($TIME + 60) && print;'`.
I have a little python script which does pretty much the same thing, with some attempts to recognize and fill in for rando date patterns just to make it a bit more universal.
I would counsel against storing human readable dates in databases and use unix time.