I’m working on microcontroller w/ a primitive standard library, and I need to convert a calendar time structure to a time-offset-from-epoch and back, ala struct tm <-> time_t. There’s no built-in function available to do this.
Could anyone refer me to a decent implementation which is open-source licensed, usable in proprietary software? (i.e. non-LGPL/GPL)
I can probably write one on my own but figured I should see if I can get a head start.
I was just thinking that BSDs use their own
libcwhen Neil Butterworth commented. Look inlib/libc/stdtime/localtime.cformktimeandtime1. You should be able to riptime1without problems.Here it is: src/lib/libc/stdtime/Attic/localtime.c