3 ms·
At one consulting gig I had at an airline, I noted that timestamps were everywhere and among the most frequent operations in the system was comparison with curr
by cratermoon 3y ago
At one consulting gig I had at an airline, I noted that timestamps were everywhere and among the most frequent operations in the system was comparison with current time. The legacy systems spit out date/time in at least 3 different formats, and almost never included the timezone. The TZ had to be determined by looking up the airport's TZ.
When I got there time comparisons were a mess, parsing in multiple places, some comparisons not taking into account the TZ, some add and subtract operations incorrectly code, and other issues.
I tried to make the case that parsing and compare timestamps was a core operation, and the system should have all that functionality polished and packaged up to its own module so programmers could focus on the rest of the system, but was unsuccessful. We were writing in Go, so the language libraries did about 80% of the work, and the less experienced programmers thought it was sufficient.
When I left they were struggling with issues around determining passenger age at the time of flight and getting off-by-one errors around certain cutoff ages.
Time is Hard. https://gist.github.com/timvisee/fcda9bbdff88d45cc9061606b4b923ca https://gist.github.com/timvisee/fcda9bbdff88d45cc9061606b4b...