3 ms·
I wouldn't consider the configuration file that says what the local timezone is a "random file" in the context of a function whose sole purpose it is to convert
by Denvercoder9 4y ago
I wouldn't consider the configuration file that says what the local timezone is a "random file" in the context of a function whose sole purpose it is to convert a timestamp to the local timezone. In fact, loading the file makes the function stateless; because if it didn't, it'd have to cache the timezone somewhere, which can get out of sync with the actual configuration.
- mike_hock 4y agoYes, caching would be even worse with no control over the cache's lifetime. You load the file into memory when I tell you to, you stringify timestamps when I tell you to, using the memory pointer I give you, and you release the memory when I tell you to. That's what a sane API looks like.