staticdata.dev
Menu
Datasets About Contact

Time Units

13 time units spanning nanosecond through millennium, each with its standard symbol and exact or conventionally-accepted equivalent in seconds. Covers sub-second precision units (ns, μs, ms), calendar units (minute, hour, day, week, month, year), and long-span units (decade, century, millennium).

Quick fetch

Stable URL. CORS-enabled. No auth.

bash
curl https://staticdata.dev/v1/time-units.json

Or use as a typed import: import { timeUnits } from "https://staticdata.dev/v1/time-units.ts"

Formats

  • JSON 995 B

    /v1/time-units.json

    Open

    min: 681 B · /v1/time-units.min.json

  • CSV 272 B

    /v1/time-units.csv

    Open
  • TypeScript 1.2 KB

    /v1/time-units.ts

    export const timeUnits

    type TimeUnit = (typeof timeUnits)[number]

    Open

Schema

Each record in the dataset has the following shape.

Schema
Field Type Description Example
name string Full English name of the time unit Second
symbol string Standard symbol or abbreviation for the unit s
seconds string Number of seconds in one unit (exact or conventional average) 3600

Preview

First 10 records.

Data preview
namesymbolseconds
Nanosecondns0.000000001
Microsecondμs0.000001
Millisecondms0.001
Seconds1
Minutemin60
Hourh3600
Dayd86400
Weekwk604800
Monthmo2629800
Yearyr31557600

Showing 10 of 13. View full data:  JSON · CSV

Fetch examples

Drop-in snippets in five languages.

curl
curl -sSL https://staticdata.dev/v1/time-units.json | jq '.[0]'
JavaScript
import type { TimeUnit } from "https://staticdata.dev/v1/time-units.ts";

const res = await fetch("https://staticdata.dev/v1/time-units.min.json");
if (!res.ok) throw new Error(`Fetch failed: ${res.status}`);
const timeUnits: TimeUnit[] = await res.json();
console.log(timeUnits[0]);
Python
import urllib.request, json

with urllib.request.urlopen("https://staticdata.dev/v1/time-units.min.json") as r:
    timeUnits = json.load(r)

print(timeUnits[0])
Go
package main

import (
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	resp, err := http.Get("https://staticdata.dev/v1/time-units.min.json")
	if err != nil { panic(err) }
	defer resp.Body.Close()

	var data []map[string]any
	if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
		panic(err)
	}
	fmt.Println(data[0])
}
Rust
use serde_json::Value;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let body = ureq::get("https://staticdata.dev/v1/time-units.min.json").call()?.into_string()?;
    let data: Vec<Value> = serde_json::from_str(&body)?;
    println!("{:?}", data.first());
    Ok(())
}

Sources and methodology

This dataset was curated from established SI (International System of Units) definitions and widely-used calendar conventions. The SI base unit for time is the second; all sub-second units (millisecond, microsecond, nanosecond) use exact SI decimal prefixes. Units from minute through week are exact integer multiples of the second. The month and year values use conventional averages: month uses 30.4375 days (365.25/12) and year uses 365.25 days — the Julian year — which is the year defined by the IAU and used by many programming libraries. Symbols such as wk, mo, yr, dec, c and ka are common abbreviations rather than SI symbols; only s (with its prefixed forms), min, h and d are recognised by the SI Brochure.

The seconds field is stored as a string to preserve exact decimal representations without floating-point rounding. For sub-second units the value is a decimal fraction (e.g., "0.001" for milliseconds); for super-second units it is an integer or decimal string. Decade, century, and millennium are derived by multiplying the Julian year by 10, 100, and 1000 respectively.

Callers requiring strict Gregorian calendar arithmetic (e.g., month = exact calendar month, year = exact 365 or 366 days) should treat the month and year values here as approximations and use a dedicated date/time library instead.

Versioning

URLs under /v1/ are stable: field names and types will not change in a way that breaks consumers. Values can be corrected or records added when the upstream source changes; schema-incompatible updates ship under a new version path. See the time-units changelog for this dataset's history.

Related datasets

More Code datasets