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.
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
min: 681 B · /v1/time-units.min.json
- CSV 272 B
/v1/time-units.csv
- TypeScript 1.2 KB
/v1/time-units.ts
export const timeUnits
type TimeUnit = (typeof timeUnits)[number]
Schema
Each record in the dataset has the following shape.
| 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.
Fetch examples
Drop-in snippets in five languages.
curl -sSL https://staticdata.dev/v1/time-units.json | jq '.[0]' 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]); 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]) 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])
} 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
- ansi-colors
- ascii
- cron-presets
- css-at-rules
- css-functions
- css-named-colors
- css-properties
- css-pseudo-classes
- css-pseudo-elements
- exit-codes
- file-signatures
- hash-algorithms
- js-array-methods
- js-math-methods
- js-object-methods
- js-string-methods
- json-schema-keywords
- jwt-claims
- mathematical-constants
- measurement-units
- node-builtin-modules
- owasp-top-10
- periodic-table
- physical-constants
- posix-signals
- programming-languages
- regex-flags
- regex-patterns
- roman-numerals
- si-base-units
- si-derived-units
- si-prefixes
- spdx-licenses
- strftime-tokens
- tailwind-colors
- unicode-blocks
- unicode-general-categories
- unicode-planes
- unix-file-permissions
- xterm-256-colors