如何将格式为 "MM-DD-YY HH:MM:SS"
的日期字符串转换为 C 或 C++ 中的 time_t
值?
最佳答案
使用strptime()
将时间解析成struct tm
,然后使用mktime()
转换成time_t
.
关于c++ - 日期/时间转换 : string representation to time_t,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/321793/