最低实现gmtime的算法? [英] Minimal implementation of gmtime algorithm?

查看:663
本文介绍了最低实现gmtime的算法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道一个简单的 gmtime的的ctime 的实施不考虑时区,没有外部的依赖,以及非copyleft的许可(BSD / MIT /任何专有的安全)? preferably在C,但基本上什么,给我的算法在其最小的形式是可行的。

Does anyone know of a simple gmtime or ctime implementation without consideration for timezone, no external dependencies, and a non-copyleft license (BSD/MIT/anything proprietary-safe)? Preferably in C, but basically anything that gives me the algorithm in its minimal form would work.

我只需要秒钟,因为1970年1月1日00:00:00细分为一年,日,月,小时,分钟,秒。而且它的时间差不多了,回家在一个星期五,所以我感觉有点懒洋洋的。

I just need seconds since "Jan 1, 1970 00:00:00" broken down into year, day, month, hr, min, sec. And it's almost time to go home on a Friday so I'm feeling a bit lazy.

推荐答案

尝试newlib
http://sourceware.org/newlib/
它是一个BSD许可。

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.

看文档 - > Timefns,看是否或的ctime gmtime的满足您的需求。

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

这篇关于最低实现gmtime的算法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆