AMM*_*AMM 3 c++ datetime parsing strptime
我正在尝试使用特定格式转换日期strptime
,并且我意识到有关AM/PM的信息丢失了.不知道为什么.
这是代码.
struct tm t;
strptime("Wed 4/18/2007 4:28:22 PM", "%a %m/%d/%Y %H:%M:%S %p", &t);
std::cout<<t.tm_hour<<endl;
strptime("Wed 4/18/2007 4:28:22 AM", "%a %m/%d/%Y %H:%M:%S %p", &t);
std::cout<<t.tm_hour<<endl;
Run Code Online (Sandbox Code Playgroud)
谁能告诉我什么是具有目的%p
的符strptime
?
在此先感谢,AJ
归档时间: |
|
查看次数: |
528 次 |
最近记录: |