Skip to main content

Convert time zones with TimeZoneDB API integration

Workflow preview

Workflow preview
100%
Convert time zones with TimeZoneDB API integration preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This n8n template provides a powerful utility for converting a specific time from one time zone to another by leveraging the TimeZoneDB API. This is an essential tool for anyone coordinating global...

Best for

  • Personal Productivity automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.webhook, n8n-nodes-base.respondtowebhook, n8n-nodes-base.httprequest

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by ist00dent.

Original n8n.io source

1.1 Workflow description

Title
Convert time zones with TimeZoneDB API integration
Workflow name
Convert time zones with TimeZoneDB API integration

This n8n template provides a powerful utility for converting a specific time from one time zone to another by leveraging the TimeZoneDB API. This is an essential tool for anyone coordinating global teams, scheduling international events, or simply needing to understand time differences across the world.


๐Ÿ”ง How it works

  • Receive Time Conversion Request: This node acts as the entry point for the workflow, listening for incoming POST requests. It's configured to expect a JSON body containing the following parameters:

    • fromZone: The IANA timezone name for the source time zone (e.g., America/New_York, Asia/Manila, Europe/London).
    • toZone: The IANA timezone name for the target time zone.
    • time: The Unix timestamp (in seconds) representing the time in the fromZone that you wish to convert.

Important: Your TimeZoneDB API key is handled securely by n8n's credential system and should not be included in the webhook body.

  • Convert Timezone (TimeZoneDB): This node makes an HTTP GET request to the TimeZoneDB API (api.timezonedb.com). It dynamically constructs the API request URL using the fromZone, toZone, and time values extracted from your webhook request. Your API key is securely retrieved from n8n's pre-configured credentials and automatically added as a query parameter. The API performs the conversion and returns a JSON object containing the converted time and other timezone details.

  • Respond with Converted Time: This node sends the full conversion result received from TimeZoneDB back to the service that initiated the webhook.


๐Ÿ‘ค Who is it for?

This workflow is extremely useful for:

  • Global Businesses & Remote Teams: Seamlessly schedule meetings, set deadlines, and coordinate tasks across different time zones, eliminating confusion and missed appointments.
  • Event Organizers & Marketers: Publish event times accurately for a global audience, improving attendance and engagement for webinars, online conferences, or product launches.
  • Customer Support Centers: Provide precise response times or service availability to customers in their local time zone, enhancing customer satisfaction.
  • Travelers & Digital Nomads: Easily calculate arrival/departure times in local timezones when planning trips or managing schedules across borders.
  • Developers & Integrators: Integrate accurate time zone conversion capabilities into custom applications, dashboards, or internal tools without building complex logic from scratch.
  • Data Analysts: Standardize timestamps from global data sources for consistent reporting and analysis, especially when dealing with international operations.

๐Ÿ“‘ Data Structure

When you trigger the webhook, send a POST request with a JSON body structured as follows:

{
  "fromZone": "America/New_York",
  "toZone": "Asia/Manila",
  "time": 1678886400  // Unix timestamp for 2023-03-15 00:00:00 UTC (example)
}

Note: You'll need to obtain a free or paid API Key from TimeZoneDB to use their API.

The workflow will return a JSON response similar to this (results will vary based on inputs):

{
  "status": "OK",
  "message": "",
  "fromZoneName": "America/New_York",
  "fromAbbreviation": "-04",
  "fromTimestamp": 1678886400,
  "toZoneName": "Asia/Manila",
  "toAbbreviation": "+08",
  "toTimestamp": 1678933200,
  "offset": 46800 // difference in seconds
}

โš™๏ธ Setup Instructions

  • Get a TimeZoneDB API Key:

  • Create an n8n Credential for TimeZoneDB:

    • In your n8n instance, go to Credentials.
    • Click "New Credential" and search for "HTTP Query Auth".
    • Set the Name (e.g., TimeZoneDB API).
    • Set API Key to your TimeZoneDB API key.
    • Set Parameter Name to key.
    • Set Parameter Position to Query.
    • Save the credential.
  • Import Workflow:

    • In your n8n editor, click "Import from JSON" and paste the provided workflow JSON.
  • Configure TimeZoneDB API Node:

    • Double-click the Convert Timezone (TimeZoneDB) node.
    • Under "Authentication", select "Generic Credential Type".
    • Choose "HTTP Query Auth" as the Generic Auth Type.
    • Select the credential you created (e.g., "TimeZoneDB API") from the dropdown.
  • Configure Webhook Path:

    • Double-click the Receive Time Conversion Request node.
    • In the 'Path' field, set a unique and descriptive path (e.g., /convert-timezone).
  • Activate Workflow:

    • Save and activate the workflow.

๐Ÿ“ Tips

This time zone converter is an essential building block that can be significantly expanded and integrated:

  • Robust Error Handling & Input Validation:

    • Upgrade: Add an IF node after the Receive Time Conversion Request to validate inputs (fromZone, toZone, time). Check if they are present and correctly formatted.
    • Upgrade: After the Convert Timezone (TimeZoneDB) node, add another IF node to check {{ $json.status === 'OK' }}. If the status is not OK, return a descriptive error message from {{ $json.message }} to the webhook caller.
    • Leverage: Provide clear feedback to users when invalid data is provided, preventing workflow failures and improving user experience.
  • Flexible Time Input:

    • Upgrade: Currently, the time input must be a Unix timestamp. Add a Function node before the Convert Timezone (TimeZoneDB) node to accept an ISO 8601 string (e.g., "2025-06-03T22:07:42Z") and convert it to a Unix timestamp using new Date($json.body.isoTime).getTime() / 1000.
    • Leverage: Make the API easier to use for callers who prefer ISO dates over Unix timestamps.
  • Human-Readable Output:

    • Upgrade: Add a Function node after Convert Timezone (TimeZoneDB). Use JavaScript's Date object and toLocaleString() to format the toTimestamp into a user-friendly string (e.g., "Tuesday, June 3, 2025, 10:07:42 PM").
    • Leverage: Provide a more immediately consumable output that doesn't require further client-side processing, enhancing integration ease.
  • Automated Meeting/Event Scheduling:

    • Upgrade: Combine this workflow with a Google Calendar or Outlook Calendar node. Accept a meeting time in one timezone and a list of attendee timezones. Loop through attendees, convert the time, and then add calendar invites for each.
    • Leverage: Fully automate the creation of timezone-aware calendar events, a huge time-saver for international teams.
  • Dynamic Website Content:

    • Upgrade: Integrate this webhook into your website's backend. When a user lands on a page with time-sensitive information, detect their IP (and thus their timezone, perhaps using a separate IP lookup service) and then use this workflow to convert all relevant times to their local time.
    • Leverage: Personalize the user experience by showing all times relevant to their location, improving clarity and usability.
  • Smart Notification Delivery:

    • Upgrade: If you send out automated notifications (e.g., Slack, Email, SMS) based on a specific time, use this workflow to ensure the notification arrives at a "friendly" local hour for each recipient.
    • Leverage: Avoid sending notifications in the middle of the night for international users, improving engagement and reducing annoyance.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Note: Webhook Input

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Note: TimeZoneDB API Call

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Note: Webhook Response

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Receive Time Conversion Request

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 5 - Respond with Converted Time

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.2

Block 6 - Convert Timezone (TimeZoneDB)

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

3. Summary Table

Workflow Convert time zones with TimeZoneDB API integration
Complexity intermediate
Nodes 6
Categories Personal Productivity
Author ist00dent
Published 03 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4624/4624.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Convert time zones with TimeZoneDB API integration do?

This n8n template provides a powerful utility for converting a specific time from one time zone to another by leveraging the TimeZoneDB API. This is an essential tool for anyone coordinating global...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Personal Productivity use case.