Hacker News new | ask | show | jobs
by valleyer 1305 days ago
Others have already corrected you, but in case it makes it more concrete, here is the implementation of timegm() in musl (the libc used in Alpine Linux and some other Linux distributions). timegm() takes a time in UTC and converts it to Unix time.

http://git.musl-libc.org/cgit/musl/tree/src/time/timegm.c

http://git.musl-libc.org/cgit/musl/tree/src/time/__tm_to_sec...

You'll notice there is no handling or knowledge of leap seconds. (Leap years are handled, of course.)