toString()

Converts a date to a string.

Syntax

toString(date, formatString)

For the allowed formats, see Date Formats.

This function is identical to date_to_string().

Note

Usage

This function must take a toDate() or now(​) function as its first argument.

Example

1q = foreach q generate toString(now(​), "yyyy-MM-dd HH:mm:ss") as ds1;