user249957
user249957

Reputation: 21

String to Time Conversion

In C++ is there any way to extract a time from a string?

CString str;
str="17:18:58,9187120";

Is there any utility for converting this string in to a Time variable?

Upvotes: 2

Views: 8088

Answers (3)

Adrian Kosmaczewski
Adrian Kosmaczewski

Reputation: 7956

The POCO library has a DateTimeParser class which might be helpful: http://www.appinf.com/docs/poco/Poco.DateTimeParser.html

Upvotes: 1

wilhelmtell
wilhelmtell

Reputation: 58667

Not in C++ or its standard library. C++ barely handles its own complexity, it's too much to ask for anything that isn't common to all cultures, platforms, galaxies and vegetables.

For now you can do with Boost's string conversion functions.

Upvotes: 0

Yin Zhu
Yin Zhu

Reputation: 17119

see this question: Convert a string to a date in C++

Upvotes: 2

Related Questions