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

...Y-MM-DD' format. add a simple test case
Why did you remove the second call to erase like this -- now rtrim will not be applied so trailing spaces will interfere. Restore this functionality and add test cases with leading and trailing spaces.