Date Time Functions
Date/time utility functions for high-precision local timestamps.
- date_time_functions.date_time_functions.date_time_stamp() str[source]
Returns a high-precision local timestamp string including:
Gregorian calendar date
Local time with nanosecond precision
IANA time zone
ISO week format: YYYY-Www-ddd
Ordinal day of the year
- Format:
‘YYYY-MMM-DDD HHH.MMM.SSS.NNNNNNNNN TZ_NAME YYYY-Www-ddd YYYY-DDD’
Example
>>> date_time_stamp() '2025-007-030 016.035.051.123456789 America/New_York 2025-W031-003 2025-211'
- Returns:
Formatted timestamp string with nanosecond precision and multiple calendar representations.
- Return type:
str
- date_time_functions.date_time_functions.generate_pdb_name_from_timestamp() str[source]
Generates a dynamic PDB name in the format: pdb_<YYYY>_<MMM>_<DDD>_<HHH>_<MMM>_<SSS>
Example
pdb_2025_007_031_017_020_008
- Returns:
Dynamically constructed PDB name based on the current local time.
- Return type:
str
- date_time_functions.date_time_functions.generate_prefixed_timestamp(prefix: str) str[source]
Generates a high-precision, time zone-aware timestamp string with a given prefix.
- The format returned is:
<prefix>_YYYY_MMM_DDD_HHH_MMM_SSS_NNNNNNNNN_TimeZone_ISOYEAR_WWWW_WEEKDAY_YYYY_DOY
Example
big_data_test_2025_007_031_019_007_040_353635000_America_slash_New_York_2025_W031_004_2025_212
- Parameters:
prefix (str) – A string prefix such as “big_data_test” or “everyday_calculations”.
- Returns:
A formatted timestamp string with the given prefix.
- Return type:
str
- date_time_functions.date_time_functions.get_timestamp() str[source]
Returns a high-precision, time zone-aware timestamp string: YYYY_MMM_DDD_HHH_MMM_SSS_NNNNNNNNN_TimeZone_ISOYEAR_WWWW_WEEKDAY_YYYY_DOY_UnixSeconds_Nanoseconds
Example
2025_008_004_013_048_029_083107000_America_slash_New_York_2025_W032_001_2025_216_1754681668_083107000