Skip to main content

UnixTimestampToDatetime

Uncontrolled node

Overview

Converts a Unix timestamp (epoch time) into a human-readable datetime string. This node supports timestamps in both seconds and milliseconds since the Unix epoch (January 1, 1970) and allows you to specify the output format and target timezone.

The node executes immediately whenever the input timestamp changes, making it ideal for converting stored timestamp data into display-friendly formats or preparing dates for specific timezone requirements.

Inputs

InputTypeDescriptionDefault
TimestampNumberThe Unix timestamp to convert. Accepts integers representing either seconds or milliseconds since epoch.-
UnitEnumThe unit of the input timestamp. Options are Seconds or Milliseconds.Milliseconds
Output FormatEnumThe desired datetime format for the output. Options include:
YYYY-MM-DD
YYYY-MM-DD HH:mm:ss
YYYY-MM-DDTHH:mm:ss
MM/DD/YYYY
DD/MM/YYYY
YYYYMMDD
YYYYMMDDHHmmss
ISO 8601 (no timezone)
YYYY-MM-DD HH:mm:ss
TimezoneEnumThe target timezone for the output datetime. Uses standard IANA timezone identifiers (e.g., UTC, America/New_York, Europe/London). Defaults to your local system timezone.Local timezone

Outputs

OutputTypeDescription
OutputTextThe formatted datetime string according to the specified output format and timezone. Returns an error object if the timestamp is invalid or conversion fails.

Runtime Behavior

As an uncontrolled node, UnixTimestampToDatetime runs automatically whenever its input values change. It does not require an event trigger to execute. The conversion happens immediately in the workflow runtime using the Temporal library for accurate timezone handling.

If the timestamp input is not a valid number or numeric string, or if the unit is not recognized, the node will output an error object with a descriptive message.

Example

Converting a millisecond timestamp:

  • Timestamp: 1704067200000
  • Unit: Milliseconds
  • Output Format: YYYY-MM-DD HH:mm:ss
  • Timezone: UTC
  • Result: 2024-01-01 00:00:00

Converting a second timestamp:

  • Timestamp: 1704067200
  • Unit: Seconds
  • Output Format: ISO 8601 (no timezone)
  • Timezone: America/New_York
  • Result: 2024-01-01T00:00:00