coates’s avatarcoates’s Twitter Archive—№ 24,109

      1. Dev/nerd friends: is there an existing well-designed data structure for minimal/incomplete dates (including sorting/math such as “difference” on these)? e.g. sometimes we have a specific second (2022-Jun-09@11:28:14UTC-4), and other times we might only have “2008-Aug” or “2003”.
    1. …in reply to @coates
      I wonder if the best way to do this is to use YYYYMMDDHHIISS (in UTC), but zero out the right side as soon as there’s a date 0. so: - 20220609152814 - 20080800000000 - 20030000000000 Still sortable, and easy to tell which part (of the date at least) is truncated… hmmm.
  1. …in reply to @coates
    Another idea is to add a trailing digit that specifies truncation. 0=Y, 1=M, 2=D, etc. so: 202206090000002 == “2022 June 9” and 202206090000005 == “2022 June 9 at 00:00:00 (midnight)” I wish I had a good place to discuss this kind stuff with peers (small IRC channels aside).
    1. …in reply to @coates
      (a trailing index digit instead of a letter specifier so it still sorts in an expected order)