For the complete documentation index, see llms.txt. This page is also available as Markdown.

Format a date

Use this helper to change date and time formats. The helper takes a date or timestamp as an input and outputs it in the specified format.

Common use-cases

  • Displaying a timestamp in a human readable format

  • Displaying a date or a time in a localized format

  • Converting a date into the specific format that other apps require (Unix timestamp, ISO)

Format a date options

These are the date output options for this helper, based on an initial input of Sunday, February 14th, 2010, at 3:25:50 pm:

Output format
Example output
Description

dddd, MMMM Do YYYY, h:mm:ss a

Sunday, February 14th 2010, 3:25:50 pm

Full date and time, 12-hour clock

MMMM Do, YYYY

February 14th, 2010

Full date, no time

YYYY-MM-DD

2010-02-14

Date in ISO 8601 format, no time

MM/DD/YY

02/14/10

Date in U.S. format, no time

MM-DD-YYYY

02-14-2010

Date in U.S. format with 4-digit year, no time

DD-MM-YYYY

14-02-2010

Date in European format, no time

ISO

2010-02-14T13:25:50.000Z

Full date and time in ISO 8601 format

UNIX

unix - 1685272216

Unix timestamp

Example 1 - American to European date format

If you have support agents in Europe and North America, and the company's database is in Standardized European format:

  1. Input dates in the American format: February 15, 2024 (02/15/2024)

  2. Select the desired European date format 15 February 2024 (15/02/2024)

The helper will then return the date in the selected format.

Example 2 - Convert ISO to UNIX

Some apps, (like Intercom and Zendesk) store dates in the UNIX format.

• UNIX timestamp: 1707955200

However, Ply outputs ISO timestamps.

• ISO 8601 format: 2024-02-15T00:00:00

With the Format a date helper, you can easily convert the ISO timestamps to UNIX format, enabling easy date and time manipulations.

Last updated