Manually define date & time format

How to manually define the date & time format when transferring data to an external system or webhook

Asta Dybdal avatar
Written by Asta Dybdal
Updated over a week ago

When transferring date and time-based data values from the platform to an external system you have the flexibility to determine the format in which the data should be transmitted.

The platform supports a wide range of industry-standard DateTime formats. However, if your system requires a specific DateTime format, you can manually define the format that the data should adhere to.

If you manually define the DateTime format, it must align with a structure supported by PHP date and time formatting. You can read more about PHP DateTime formatting here.

The format for the date and time in PHP is defined by using format codes. Here are some common format codes:

  • Y: Four-digit year (e.g., 2024)

  • m: Two-digit month (01 through 12)

  • d: Two-digit day of the month (01 through 31)

  • H: Two-digit hour in 24-hour format (00 through 23)

  • i: Two-digit minutes (00 through 59)

  • s: Two-digit seconds (00 through 59)

You can combine these format codes with various characters (like slashes, dashes, colons, etc.) to create the desired format.

Below you can find some examples of how you can format the date and time and what the output would look like in the specified format:

Standard Date Format:

  • Format: Y-m-d

  • Example Output: 2024-02-12

Date and Time in 24-hour format:

  • Format: Y-m-d H:i:s

  • Example Output: 2024-02-12 15:30:45

Short Month and Year:

  • Format: M Y

  • Example Output: Feb 2024

Day of the Week, Month, Day, Year, Time:

  • Format: l, F j, Y H:i:s

  • Example Output: Monday, February 12, 2024 15:30:45

Timestamp:

  • Format: U (Unix timestamp)

  • Example Output: 1673668245

Custom format: YYYYMMDDHHmmSS:

  • Format: YmdHis

  • Example Output: 20240212153045

These are just a few examples, and you can customize the formats according to your specific needs by combining the format codes in different ways.

Did this answer your question?