2

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?

avakar
  • 32,009
  • 9
  • 68
  • 103
user249957
  • 21
  • 1
  • 2

3 Answers3

2

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

Community
  • 1
  • 1
Yin Zhu
  • 16,980
  • 13
  • 75
  • 117
1

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

Adrian Kosmaczewski
  • 7,956
  • 4
  • 33
  • 59
0

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.

wilhelmtell
  • 57,473
  • 20
  • 96
  • 131