trying to use std::get_time to parse YYMMDD and failing

后端 未结 1 932
清酒与你
清酒与你 2020-12-11 04:17

I\'m trying to do this and failing:

std::istringstream ss(\"1212\");
ss >> std::get_time(&t, \"%y%m\");
if (ss.fail()) // every time!
相关标签:
1条回答
  • 2020-12-11 05:02

    Visual Studio does not seem to implement the spec properly, nor did GCC until version 5.0. If you continue to use std::get_time with VS13 or even VS15, you will need to manually add delimiters to be able to parse times until they finally get around to realizing this bug.

    0 讨论(0)
提交回复
热议问题