Date/time conversion: string representation to time_t

What's the best way to convert a date string, formatted as "MM-DD-YY HH:MM:SS", to a time_t value in either C or C++?

Answers


Use strptime() to parse the time into a struct tm, then use mktime() to convert to a time_t.


Need Your Help

Using Selenium and Python to push text to Array

python arrays string unicode selenium-webdriver

Currently I am using Selenium to scrape a website and it is working nicely up until now. I have Selenium find some text on a page and push it to an Array which will then be output to a CSV file. My

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.