Cast functions between Date, DateTime and TimeStamp