Minimal implementation of gmtime algorithm?

南楼画角 提交于 2019-11-29 14:42:39

Try newlib http://sourceware.org/newlib/ it is a BSD license.

It is designed for embedded systems, so tends to be quite small and simple.

Look at Docs -> Timefns to see if ctime or gmtime meet your needs.

Reverse the algorithm defining "Seconds Since the Epoch" from POSIX:

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_15

tm_sec + tm_min*60 + tm_hour*3600 + tm_yday*86400 +
    (tm_year-70)*31536000 + ((tm_year-69)/4)*86400 -
    ((tm_year-1)/100)*86400 + ((tm_year+299)/400)*86400
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!