4 ms·
I'd suggest using timegm instead of mktime, or set the TZ environment variable to UTC to ensure all implementations return an identical date. I ran the same tes
by MishraAnurag 13y ago
I'd suggest using timegm instead of mktime, or set the TZ environment variable to UTC to ensure all implementations return an identical date. I ran the same tests and found that the strptime was quite fast, but gmtime was taking most of the time. To speed that up, you could borrow SQLite's implementation. Checkout the computeJD function from SQLite's date.c - http://www.sqlite.org/src/doc/trunk/src/date.c http://www.sqlite.org/src/doc/trunk/src/date.c
- jurre 13y agotimegm actually already makes a huge difference, thanks! Might be useful to make a small fast date parsing library based on the sqlite source code.