开发者

Conversion of string to time_t

Is there a way to convert a string val开发者_如何转开发ue into time_t format?

Thanks in advance.


One approach could be to parse the string into the various components and use them to fill a tm structure. Once you have the structure filled with data you can use the C function mktime to convert the structure into a time_t type.

There might be more ideal ways to do this in visual C++, but in normal C/C++ this is probably the way i'd do it untill I'd find a better algorithm.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜