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

...Y-MM-DD' format. add a simple test case
I'm sorry for the misleading advice: I should have said "calling castAs(VALUE_TYPE_TIMESTAMP)".