API
公開タイムAPI(v1)
現在の瞬間、形式変換、タイムゾーン変換のJSONエンドポイント。CORS *、v1はAPIキー不要。レート制限:IP ごとに 60 秒あたり 120 リクエスト。超えると Retry-After ヘッダー付きの HTTP 429 を返します。安全重要の計時には使わないでください。
GET /api/v1/now
クエリ:format(iso | unix | unix_ms | rfc2822 | http | custom)、tz(IANA)、custom時は任意のpattern(YYYY MM DD HH mm ss Z X x)。
curl "https://time.foo/api/v1/now?format=iso&tz=Asia/Singapore"
GET /api/v1/convert
クエリ:from(ISOまたはunix秒/ms)、from_tz、to_tz、format、任意のpattern。
curl "https://time.foo/api/v1/convert?from=1700000000&to_tz=America/New_York&format=iso"
GET /api/v1/timezone
クエリ:任意のtime、from_tz、to_tz — 両ゾーンのオフセットとISOラベルを返します。
curl "https://time.foo/api/v1/timezone?from_tz=UTC&to_tz=Asia/Tokyo"
ディスカバリ
GET /api/v1/ はJSONインデックスを返します。エラー例 {"error":"bad_request","message":"..."}。
未知のクエリパラメーターには、使えるパラメーター一覧付きで 400 を返します(例:/timezone は tz ではなく from_tz と to_tz)。