Improved date and date_time typecasting.
Merge pull request #3 from Exoth/master

Improved date and date_time typecasting.