stop internally representing timestamps as strings

timestamps were never supposed to be readable by both humans and machines simultaneously

@retr0id
"Hello I didn't mean 18:20:00+00:00 I specifically meant 18:20:00Z and I want the Z preserved"

statements dreamt up by the utterly deranged

@wolf480pl lol - is there any world in which they're not semantically equivalent?

@retr0id idk but my point is, a string representation preserves useless syntactical information that doesn't affect the meaning of the timestamp, and leaves more room for invalid values or parser confusion due to differing implementation details.
Who'd want any of that?

@wolf480pl For some fun extra context, timestamps are on my mind because I recently broke large portions of the Bluesky ecosystem with the timestamp "0000-01-01T00:00:00+14:00"

@retr0id and storing that as a pair of int64_t (ts, zone) and serializing to a normalized isoformat for interchange would've avoided that problem? Interesting....

@wolf480pl noooo! timezone is not relevant information! it should not be stored here! Any integer serialisation of UTC (or maybe even TAI if you're feeling adventurous) would solve this
@wolf480pl and if you *really* want to encode the timezone of a poster for some reason, that should be like, an entirely separate informational field
@wolf480pl oh I can kinda see the usecase there, if a human has said "do this task at 6pm evey day" a la crontab

@retr0id @wolf480pl some collaboration tools do stuff like "x sent y at 1pm (5pm their time)", which is somewhat useful.

@retr0id @wolf480pl also if you're keeping statistics about a business' operation, keeping timestamps of sales, resupplies and other events as ISO-8601 strings makes it easier to do a global analysis of these events relative to local time of day.

@retr0id @wolf480pl this post inspired me to think up a truly cursed data format – binary ISO-8601.
version A (unholy combination): 59 bits unix timestamp, 1 bit timezone sign, 4 bits timezone hour offset
version B1 (actual 64-bit ISO-8601): 50 bits year, 4 month, 5 day, 1 timezone sign, 4 timezone hour offset
version B2 (ISO-8601 extended 64-bit equivalent): 1 bit year sign, 49 year, 4 month, 5 day, 1 timezone sign, 4 timezone hour offset

@Amikke @wolf480pl you seem to have forgotten that there are timezones with non-integer hour offsets :P
Follow

@retr0id t-there are? oh god
dates and time, every time

@Amikke but of course, iso8601 lets you encode arbitrary minute offsets (maybe even seconds? idk I'm too lazy to read it and find out)
Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.