• Advertisement

Archived

This topic is now archived and is closed to further replies.

Reverse of 'ctime' function

This topic is 5457 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Just as ctime takes a time_t and returns a char*, is there an equivalent function anywhere that will take a char* that is supposedly the output of a time_t, and return the appropriate time_t? I''d think there''d be something like this in a mail package, but I''ve not found one yet. There seems to be a ''strptime'' in some implementations which returns a ''struct tm'' that I could probably use, but does anyone have anything better? I am aware there may be locale issues here, too. [ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]

Share this post


Link to post
Share on other sites
Advertisement
If you''re not too averse to using strptime (locale issues aside) to get a struct tm*, then you can use mktime to get a time_t out of that.

- dorix

Share this post


Link to post
Share on other sites

  • Advertisement