1001fx - NoCode functions icon

1001fx - NoCode functions

1001fx is a set of functions for any automation platform. Our functions are simple, very well tested, scalable and offer features that most automation platforms do not offer.

Actions74

datetime → Convert a Date to a Timezone

AI-generated

Overview

This node allows you to convert a date and time from one timezone to another. It is useful in workflows where you need to standardize or localize datetime values, such as when processing data from users in different regions, scheduling events, or integrating with systems that require specific timezone formats.

Practical examples:

  • Converting user-submitted dates (e.g., from a web form) into UTC for storage.
  • Adjusting event times to the recipient's local timezone before sending notifications.
  • Synchronizing logs or records across systems operating in different timezones.

Properties

Name Meaning
Datetime The date to format. Your date needs to be in one of the following formats:
DD.MM.YYYY, DD.MM.YY, DD.MM.YYYY HH:mm, DD.MM.YY HH:mm, MM-DD-YYYY, MM-DD-YYYY HH:mm, MM-DD-YY, MM-DD-YY HH:mm.
From timezone The timezone the datetime is currently in. Options include a comprehensive list of IANA timezones (e.g., Europe/Berlin, America/New_York, Asia/Tokyo, etc.).
To timezone The timezone to convert the datetime to. Options are the same as "From timezone" and cover all major global timezones.

Output

The output will be a JSON object containing the converted date and time in the target timezone. The exact structure may vary depending on the API response, but typically you can expect:

{
  "convertedDatetime": "2024-06-01T15:00:00+02:00"
}
  • convertedDatetime: The input date and time, converted to the specified "To timezone", formatted as an ISO8601 string.

If the operation fails, the output may contain an error message:

{
  "error": "Invalid date format"
}

Dependencies

  • External Service: Requires access to the 1001fx API.
  • API Key: You must configure the 1001fxApi credential in n8n.
  • No additional environment variables are required beyond the API key setup.

Troubleshooting

Common issues:

  • Invalid date format: Ensure your input matches one of the supported formats (see "Datetime" property).
  • Timezone not selected: Both "From timezone" and "To timezone" must be set to valid options.
  • API authentication errors: Make sure your 1001fxApi credentials are correctly configured in n8n.

Error messages:

  • "Invalid date format": The provided date does not match any of the accepted formats. Double-check your input.
  • "Missing required parameter": One or more required fields ("Datetime", "From timezone", "To timezone") are empty.
  • "Unauthorized": Your API key is missing or incorrect. Check your n8n credentials.

Links and References

Discussion