MeridianMERIDIAN

SQL Timestamp with Microseconds

Space-separated date and time with 6-digit microsecond precision. Default output of Python str(datetime.now()) and PostgreSQL TIMESTAMP. Distinct from iso_8601_microseconds by space (not T) separator.

SQL Timestamp with Microseconds

datetime.timestamp.sql_microseconds

Space-separated date and time with 6-digit microsecond precision. Default output of Python str(datetime.now()) and PostgreSQL TIMESTAMP. Distinct from iso_8601_microseconds by space (not T) separator.

Domain
datetime
Category
timestamp
Casts to
TIMESTAMP
Scope
Universal

Try it

CLI
$ finetype infer -i "2024-01-15 14:30:00.123456" --mode column
→ datetime.timestamp.sql_microseconds

DuckDB

Detect
SELECT ft_infer('2024-01-15 14:30:00.123456');
-- → 'datetime.timestamp.sql_microseconds'
Cast expression
strptime({col}, '%Y-%m-%d %H:%M:%S.%f')
-- Format: %Y-%m-%d %H:%M:%S.%f
Safe cast pipeline
-- Normalise and cast in one step
SELECT TRY_CAST(ft_cast(my_column) AS TIMESTAMP) AS clean_value
FROM my_table
WHERE ft_infer(my_column) = 'datetime.timestamp.sql_microseconds';

JSON Schema

finetype taxonomy datetime.timestamp.sql_microseconds -o json-schema
{
  "$id": "https://meridian.online/schemas/datetime.timestamp.sql_microseconds",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Space-separated date and time with 6-digit microsecond precision. Default output of Python str(datetime.now()) and PostgreSQL TIMESTAMP. Distinct from iso_8601_microseconds by space (not T) separator.",
  "examples": [
    "2024-01-15 14: 30: 00.123456",
    "2019-12-31 23: 59: 59.000000",
    "2023-06-01 08: 15: 30.789012"
  ],
  "maxLength": 26,
  "minLength": 26,
  "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{6}$",
  "title": "SQL Timestamp with Microseconds",
  "type": "string",
  "x-finetype-label": "datetime.timestamp.sql_microseconds",
  "x-finetype-pii": false
}

Examples

2024-01-15 14:30:00.1234562019-12-31 23:59:59.0000002023-06-01 08:15:30.789012

Aliases

sql_micro

Type Registry