By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,227 Members | 1,226 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,227 IT Pros & Developers. It's quick & easy.

String date to time_t

P: 1
High all,

I want to calculate the difference between two date with DiffTime function which use time_t structure of the two date. But the two date are in string format. So, how can I do to convert date string in tim_t ?

Thank you in advance.
Jun 11 '07 #1
Share this Question
Share on Google+
2 Replies


weaknessforcats
Expert Mod 5K+
P: 9,197
You will need to convert your date string into seconds and put the result in a time_t.
Jun 11 '07 #2

100+
P: 208
High all,

I want to calculate the difference between two date with DiffTime function which use time_t structure of the two date. But the two date are in string format. So, how can I do to convert date string in tim_t ?

Thank you in advance.
1. parse your string into a struct tm
2. Call mktime() store it into your time_t var
Jun 11 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.