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

...Y-MM-DD' format. add a simple test case
We do not need this function. Tests can use the public "castAs(VALUE_TYPE_TIMESTAMP)".