关于时间转换可以参考以下博客:
https://www.jianshu.com/p/80de04b41c31
https://www.cnblogs.com/qicosmos/p/3642712.html
https://blog.csdn.net/wizardtoh/article/details/81738682
https://blog.csdn.net/hou8389846/article/details/77962343
get_time put_time相关
https://blog.csdn.net/wangjieest/article/details/7761051
https://www.yiibai.com/cpp_standard_library/cpp_get_time.html
time_point 相关
https://www.xuebuyuan.com/716692.html?mobile=1
hdu 6491
Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 153 Accepted Submission(s): 96
#include<bits/stdc++.h> using namespace std; int main() { string s; stringstream ss; s = "2050-01-01 00:00:00"; ss << s; tm beg ; ss >> get_time(&beg,"%Y-%m-%d"); ss >> get_time(&beg,"%H:%M:%S"); auto next_time = chrono::system_clock::from_time_t(time_t(mktime(&beg))); int n; cin>>n; while(n--) { tm ed; cin >> get_time(&ed,"%Y-%m-%d"); cin >> get_time(&ed,"%H:%M:%S"); auto from_time = chrono::system_clock::from_time_t(time_t(mktime(&ed))); auto diff = next_time - from_time ; cout<<abs(chrono::duration_cast<chrono::seconds>(diff).count())%100<<endl; } return 0; }
原文:https://www.cnblogs.com/wujiechao/p/10765402.html