use sscanf to extract info from a timestamp string. Now it supports 'YYY...

...Y-MM-DD' format. add a simple test case
Since these format values are only used as const char*, there is no benefit to wrapping these constants in a std::string.
And there may be benefit to defining them as const char*.