开发者

Conversion of string to time_t

开发者 https://www.devze.com 2023-02-12 02:36 出处:网络
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 structu

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

精彩评论

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

关注公众号