タイムゾーンDB APIを使用して時差を変換する

中級

これはBuilding Blocks分野の自動化ワークフローで、6個のノードを含みます。主にWebhook, HttpRequest, RespondToWebhookなどのノードを使用。 TimeZoneDB API統合を使用してタイムゾーンを変換する

前提条件
  • HTTP Webhookエンドポイント(n8nが自動生成)
  • ターゲットAPIの認証情報が必要な場合あり
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "id": "P7c87hjmVGCrI5Hd",
  "meta": {
    "instanceId": "1777696fb9fddfee653e70940936c2b1e28ba1f1bde53b7182fbd6eb01988706"
  },
  "name": "Convert Time Zones with TimeZoneDB API Integration",
  "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 Input\n\nThis node listens for incoming POST requests. It expects a JSON body with the following properties:\n\n* `fromZone` (source timezone IANA name, e.g., `America/New_York`)\n* `toZone` (target timezone IANA name, e.g., `Europe/London`)\n* `time` (Unix timestamp in seconds, e.g., `1678886400` for March 15, 2023 12:00:00 PM UTC)\n\n**Note:** The TimeZoneDB API key is handled securely by n8n's credential system and should **not** be included in the webhook body."
      },
      "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 Call\n\nThis node makes an HTTP GET request to the TimeZoneDB API's `convert-time-zone` endpoint. It dynamically constructs the URL using the source zone, target zone, and Unix timestamp provided in the webhook body.\n\n**Crucially, the API key is retrieved securely from n8n's pre-configured credentials**, ensuring it is not exposed directly in the workflow's URL parameters or webhook body. This fetches the converted time."
      },
      "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 Response\n\nThis node sends the conversion result received from the TimeZoneDB API back to the original webhook caller. The response includes the converted time, the time zone names, and status information provided by the API."
      },
      "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": {
    "202847ea-f056-455f-970c-758ce5d61e17": {
      "main": [
        [
          {
            "node": "f3725910-1f3f-44c8-9c54-3fd4a55ea524",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f5e1f969-313f-4ac0-bc53-91bb66556254": {
      "main": [
        [
          {
            "node": "202847ea-f056-455f-970c-758ce5d61e17",
            "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で表示

このワークフローを共有

カテゴリー

カテゴリー: 34