Meridianmeridian

Unix Epoch Nanoseconds

datetime.timestamp.epoch_nanoseconds

Nanoseconds since Unix epoch (1970-01-01T00:00:00Z). 19-digit integer. OpenTelemetry time_unix_nano, Go time.UnixNano(). Distinct from other epoch formats by digit count (19 vs 10/13/16).

Domain
datetime
Category
timestamp
Casts to
TIMESTAMP
Scope
Universal

Try it

CLI
$ finetype infer -i "1705325400000000000"
→ datetime.timestamp.epoch_nanoseconds

DuckDB

Detect
SELECT finetype('1705325400000000000');
-- → 'datetime.timestamp.epoch_nanoseconds'
Cast expression
epoch_ns({col})
Safe cast pipeline
-- Normalise and cast in one step
SELECT TRY_CAST(finetype_cast(my_column) AS TIMESTAMP) AS clean_value
FROM my_table
WHERE finetype(my_column) = 'datetime.timestamp.epoch_nanoseconds';

JSON Schema

finetype schema datetime.timestamp.epoch_nanoseconds
{
  "$id": "https://meridian.online/schemas/datetime.timestamp.epoch_nanoseconds",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Nanoseconds since Unix epoch (1970-01-01T00: 00: 00Z). 19-digit integer. OpenTelemetry time_unix_nano, Go time.UnixNano(). Distinct from other epoch formats by digit count (19 vs 10/13/16).",
  "examples": [
    "1705325400000000000",
    "1704067199000000000",
    "1717228530000000000"
  ],
  "maxLength": 19,
  "minLength": 19,
  "pattern": "^\\d{19}$",
  "title": "Unix Epoch Nanoseconds",
  "type": "string",
  "x-finetype-broad-type": "TIMESTAMP",
  "x-finetype-transform": "epoch_ns({col})"
}

Examples

170532540000000000017040671990000000001717228530000000000

Aliases

unix_nano