ecx:formatTimestamp
    • 1 Minute to read
    • Dark
      Light

    ecx:formatTimestamp

    • Dark
      Light

    Article summary

    The function ecx:formatTimestamp returns a timestamp in the desired string format. The value returned is a string data type.

    Example

    Apply a specific date format to a timestamp and change the time zone to Central European Time (UTC+10:00).

    ${ecx:formatTimestamp('1272381141000', 'EEEE, MMMMM d, hh:mm aaa', ecm:timeZone('Europe/Berlin'), 'en', true)}

    The output is displayed as ​Tuesday, April 27, 05:12 PM CEST.

    Structure​

    ecx:formatTimestamp(long, timezone, String, Boolean)

    Parameters​

    Parameter

    Description

    long

    Specifies the target long integer to format.

    timezone

    Specifies the output time zone.

    string

    Variable localeCode, applies a country-specific format to the date according to the ISO language code used.

    Boolean

    Variable withTimeZone, specifies whether the formatted date includes an abbreviation for the time zone.


    Was this article helpful?

    What's Next