convert a string in to time format in c

落爺英雄遲暮 提交于 2019-12-11 18:36:41

问题


suppose I have a string "2011-08-21 21:48:45 +1200",and another one with the same format,
I want to compare these 2 strings to find out which one is the early one or later one,
is there a easy way to convert a string to time format rather than compare them by characters? Thanks


回答1:


use getdate or strptime().



来源:https://stackoverflow.com/questions/7524543/convert-a-string-in-to-time-format-in-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!