DevToolBox

ISO 8601 Formatter & Parser

日時をISO 8601形式へ変換し、ISO8601文字列を構成要素とタイムゾーンに分解・検証します。全てブラウザ内で処理。

How to Use

Select 日時から変換 to turn a local date and time into a UTC ISO 8601 string, or ISO文字列を検証 to validate an existing value. The current-time button produces a value such as 2026-07-20T10:30:00.000Z. Parse mode displays each component and the equivalent UTC instant.

ISO 8601 structure

A complete timestamp combines a calendar date, the literal T separator, 24-hour time, optional fractional seconds, and a zone designator. Z means UTC; +09:00 states an offset. Validation requires a zone so the instant is not ambiguous.

JavaScript Date.toISOString()

Date.prototype.toISOString() converts an instant to UTC and emits fixed-width milliseconds ending in Z. A datetime-local input has no zone, so this page first interprets it in the device's local timezone.

REST APIs and databases

ISO 8601 suits REST payloads because ordering is unambiguous and offsets travel with values. Database behavior depends on the engine and column type: an instant-aware type may normalize to UTC, while a zone-less timestamp can discard offset semantics. Store an IANA zone separately when daylight-saving history matters.

使い方

「日時から変換」では端末のローカル日時を入力します。「ISO文字列を検証」ではZまたは+09:00などを含む文字列を入力すると、年月日・時分秒・ミリ秒・タイムゾーンを分解表示します。現在時刻ボタンではクリック時点のUTCを即座に生成します。

Z表記とタイムゾーンオフセット

2026-07-20T10:30:00ZZはUTCです。2026-07-20T19:30:00+09:00は日本標準時で、両者は同じ瞬間です。toISOString()はUTCへ正規化するため、元のオフセット自体は残りません。

検証ロジックと境界値

形式だけでなく、月の日数、うるう年、24時間制の時刻、オフセットの時・分も検証します。2025-02-29や25時は拒否されます。処理系ごとに対応が異なるうるう秒の60は受け付けません。

API・データベース設計

REST APIではUTCへ統一すると比較やログ追跡が容易です。予約時刻など地域の壁時計時刻が重要なら、UTCの瞬間に加えてAsia/TokyoのようなIANAタイムゾーン名を保持してください。timestamp型がオフセットを保存するかは製品と型により異なります。

よくあるエラーと対処 / Common Errors and Fixes

症状 / Error原因 / Cause対処 / Fix
形式エラー / Format errorTやzoneがない / Missing T or zone2026-07-20T10:30:00Zの完全形式にする / Add Z or offset
9時間ずれる / Nine-hour shiftJSTがUTCになった / JST normalized to UTCTimezone Converterで表示地域を変換 / Convert display zone
2月29日が拒否 / Feb 29 rejectedうるう年ではない / Not a leap year年または日を修正 / Correct year or day
DBでoffsetが消える / Offset lost in DB型がzoneを破棄 / Type discarded zoneUTC値とIANA zoneを別に保存 / Store both separately

言語別コード例 / Code Examples

JavaScript

const date = new Date("2026-07-20T19:30:00+09:00");
if (Number.isNaN(date.getTime())) throw new Error("Invalid date");
console.log(date.toISOString()); // 2026-07-20T10:30:00.000Z

Python

from datetime import datetime, timezone
value = "2026-07-20T19:30:00+09:00"
dt = datetime.fromisoformat(value.replace("Z", "+00:00"))
print(dt.astimezone(timezone.utc).isoformat(timespec="milliseconds").replace("+00:00", "Z"))

Go

value := "2026-07-20T19:30:00+09:00"
t, err := time.Parse(time.RFC3339, value)
if err != nil { log.Fatal(err) }
fmt.Println(t.UTC().Format("2006-01-02T15:04:05.000Z"))

Before / After 実例

Before(入力)After(UTC ISO 8601)意味
2026-07-20 19:30(JST端末)2026-07-20T10:30:00.000Zローカル日時をUTCへ変換
2026-07-20T19:30:00+09:002026-07-20T10:30:00.000ZオフセットをUTCへ正規化
2026-02-30T10:00:00ZValidation error存在しない日付を検出

Why browser-only?

Dates can reveal operational schedules, release windows, or customer activity. Formatting and validation run locally in your browser with no external API request, so entered values are not sent to our server.

日時には運用スケジュールや顧客活動などの情報が含まれる場合があります。本ツールはブラウザ内だけで実行し、外部APIを呼び出さないため、入力値は変換のためにサーバーへ送信されません。

関連ツール・ガイド

開発をもっと効率的に

PR