Skip to main content

Module time

Module time 

Source
Expand description

Time format conversion utilities

This module provides functionality for converting time format strings between different SQL dialects. For example, converting Python strftime formats to Snowflake or BigQuery formats.

Based on the Python implementation in sqlglot/time.py.

Modules§

format_mappings
Common format mapping for Python strftime to various SQL dialects

Statics§

TIMEZONES
Set of valid timezone names (lowercase)

Functions§

build_format_trie
Build a trie from format mapping keys
format_time
Convert a time format string using a dialect-specific mapping
is_valid_timezone
Check if a string is a valid timezone name
subsecond_precision
Extract subsecond precision from an ISO timestamp literal