Skip to content

Notes from the bench

Why I wrote my own date-time parser

1488153600. Is that seconds or milliseconds? You find out when the date lands in 1970 or in the year 49,000. APIs send timestamps like that since a number is fast to parse. I wanted to see how much of that is real, so I wrote a parser this weekend.

When core data changes, something else has to happen. A cache entry must go, a search index must be updated, and an audit log wants to know what the value was before. I had one mechanism for all three in my previous job, and missed it in the new one. So I built it again from scratch.