toDateTime(string, format)

Converts a date in string format to a DateTime type. “format” specifies the date format and can be any valid date format.

1q = foreach q generate toDateTime('CloseDate',"yyyy/MM/dd") as DateTime;

For the allowed formats, see Date Formats.

If a format argument isn’t provided, the function uses the format yyyy-MM-dd HH:mm:ss. format is only valid for converting date string values. It isn’t valid for converting epoch numerical values.