Ido Toolbox icon

Ido Toolbox

A comprehensive collection of useful tools for data processing, text manipulation, and daily operations

Other Tool → Convert Timezones

AI-generated

Overview

This node provides a versatile toolbox of utility operations, including one that converts date/time strings from one timezone to another. The "Convert Timezones" operation takes a date/time string and translates it from a specified source timezone to a target timezone, outputting the converted date/time in a standardized format.

This is useful in scenarios where workflows handle data across multiple timezones, such as scheduling events, logging activities, or integrating systems with different regional settings. For example, converting a meeting time scheduled in New York (Eastern Time) to Jerusalem time for local notifications.

Properties

Name Meaning
Date Time String The input date/time string to convert. Example: "2024-01-01 12:00:00".
Source Timezone The timezone of the input date/time string. Options include: Berlin, Central Time, Eastern Time, GMT, Jerusalem, London, Mountain Time, Pacific Time, Paris, Sydney, Tokyo, UTC. Default is UTC.
Target Timezone The timezone to convert the input date/time into. Same options as Source Timezone. Default is Asia/Jerusalem.

Output

The output JSON object contains:

  • originalDateTime: The original input date/time string.
  • sourceTimezone: The source timezone used for conversion.
  • targetTimezone: The target timezone used for conversion.
  • convertedDateTime: The converted date/time string in ISO format but with space instead of 'T' and trimmed to seconds (e.g., "2024-01-01 14:00:00").
  • sourceOffset: The offset in minutes of the source timezone relative to UTC.
  • targetOffset: The offset in minutes of the target timezone relative to UTC.

This output allows downstream nodes to use the converted date/time directly or perform further processing.

Dependencies

  • No external API calls or services are required.
  • The node uses JavaScript's built-in Date object and a hardcoded mapping of timezone offsets in minutes.
  • No special environment variables or credentials are needed.

Troubleshooting

  • Invalid date/time format or timezone: If the input date/time string is malformed or the timezone is not recognized, the node throws an error. Ensure the date/time string matches a valid format (e.g., "YYYY-MM-DD HH:mm:ss") and the timezone is selected from the provided list.
  • Timezone offset limitations: The node uses a fixed offset map and does not account for daylight saving time changes dynamically. This may cause inaccuracies during DST transitions.
  • Input string without time component: Providing only a date without time might lead to unexpected results; always include both date and time for accurate conversion.

Links and References

Discussion