是否有适用于 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 上等价?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
Windows 中的 boost_1_60_0 .zip 安装boost_1_60_0 .zip installation in windows(Windows 中的 boost_1_60_0 .zip 安装)
如何使用 Windows 程序在 C++ 中获得控制台输出?How do I get console output in C++ with a Windows program?(如何使用 Windows 程序在 C++ 中获得控制台输出?)
如何计算给定日期的周数?How do I calculate the week number given a date?(如何计算给定日期的周数?)
带有网络摄像机的 OpenCVOpenCV with Network Cameras(带有网络摄像机的 OpenCV)
创建 DLL 时导出所有符号Export all symbols when creating a DLL(创建 DLL 时导出所有符号)
Windows 7 上的 OpenCV 2.4 和 MinGW 入门Getting started with OpenCV 2.4 and MinGW on Windows 7(Windows 7 上的 OpenCV 2.4 和 MinGW 入门)