8
n8n 中文网amn8n.com

通过 TimeZoneDB API 集成转换时区

中级

这是一个Building Blocks领域的自动化工作流,包含 6 个节点。主要使用 Webhook, HttpRequest, RespondToWebhook 等节点。 使用TimeZoneDB API集成转换时区

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "P7c87hjmVGCrI5Hd",
  "meta": {
    "instanceId": "1777696fb9fddfee653e70940936c2b1e28ba1f1bde53b7182fbd6eb01988706"
  },
  "name": "通过 TimeZoneDB API 集成转换时区",
  "tags": [],
  "nodes": [
    {
      "id": "5b7534b7-7ad2-4f8e-9ef0-67bae5b9295b",
      "name": "注意:Webhook 输入",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        80
      ],
      "parameters": {
        "width": 340,
        "height": 560,
        "content": "## Webhook 输入"
      },
      "typeVersion": 1
    },
    {
      "id": "25af01e7-59e7-4339-adbf-07fd1398135c",
      "name": "注意:TimeZoneDB API 调用",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        160
      ],
      "parameters": {
        "color": 2,
        "width": 400,
        "height": 480,
        "content": "## TimeZoneDB API 调用"
      },
      "typeVersion": 1
    },
    {
      "id": "a5f0025b-1291-4e6d-ad83-90742eb69e12",
      "name": "注意:Webhook 响应",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1740,
        240
      ],
      "parameters": {
        "color": 3,
        "width": 360,
        "height": 400,
        "content": "## Webhook 响应"
      },
      "typeVersion": 1
    },
    {
      "id": "f5e1f969-313f-4ac0-bc53-91bb66556254",
      "name": "接收时间转换请求",
      "type": "n8n-nodes-base.webhook",
      "position": [
        1000,
        480
      ],
      "webhookId": "convert-timezone-request",
      "parameters": {
        "path": "convert-timezone",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "f3725910-1f3f-44c8-9c54-3fd4a55ea524",
      "name": "返回转换后的时间",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1860,
        480
      ],
      "parameters": {
        "options": {},
        "respondWith": "allIncomingItems"
      },
      "typeVersion": 1.2
    },
    {
      "id": "202847ea-f056-455f-970c-758ce5d61e17",
      "name": "转换时区(TimeZoneDB)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1440,
        480
      ],
      "parameters": {
        "url": "=http://api.timezonedb.com/v2.1/convert-time-zone?format=json&from={{$json.body.fromZone}}&to={{$json.body.toZone}}&time={{$json.body.time}}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth"
      },
      "credentials": {
        "httpQueryAuth": {
          "id": "RdVVfStIsheYjSeZ",
          "name": "TimeZoneDB API"
        }
      },
      "typeVersion": 4.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "05d74ef8-eb7c-442c-9786-0d40880fc9d7",
  "connections": {
    "Convert Timezone (TimeZoneDB)": {
      "main": [
        [
          {
            "node": "Respond with Converted Time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Time Conversion Request": {
      "main": [
        [
          {
            "node": "Convert Timezone (TimeZoneDB)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 构建模块

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量6
分类1
节点类型4
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
ist00dent

ist00dent

@ist00dent

I’m a dedicated automation engineer passionate about no-code and low-code solutions. I design and implement robust n8n workflows—integrating APIs, databases, and messaging—to eliminate manual tasks and accelerate delivery. Leveraging Python and C#, I build scalable, adaptable automations that empower teams to focus on high-value work.

外部链接
在 n8n.io 查看

分享此工作流