added cast function for timestamp type

same here