strptime()等效于Windows? [英] strptime() equivalent on Windows?

查看:163
本文介绍了strptime()等效于Windows?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有适用于Windows的 strptime()的良好的等效实现?不幸的是,这个POSIX功能似乎不可用。

Is there a good equivalent implementation of strptime() available for Windows? Unfortunately, this POSIX function does not appear to be available.

打开strptime的组描述 - 摘要:它转换文本字符串,如MM-DD-YYYY HH:MM:SS进入 tm struct ,与 strftime()相反。

Open Group description of strptime - summary: it converts a text string such as "MM-DD-YYYY HH:MM:SS" into a tm struct, the opposite of strftime().

推荐答案

可以在这里找到 strptime()的开源版本(BSD许可证): http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/time/ strptime.c?rev = HEAD

An open-source version (BSD license) of strptime() can be found here: http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/time/strptime.c?rev=HEAD

您需要添加以下声明才能使用:

You'll need to add the following declaration to use it:

char *strptime(const char * __restrict, const char * __restrict, struct tm * __restrict);

这篇关于strptime()等效于Windows?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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