Skip to main content

Module timezone

Module timezone 

Source
Expand description

DST timezone helpers for German MESZ/MEZ validation.

EU DST rule: MESZ (summer time) starts the last Sunday of March at 01:00 UTC, and ends the last Sunday of October at 01:00 UTC.

Functions§

dst_transitions_between
Net DST delta across two UTC instants (expressed in epoch minutes).
dtm_after
Whether a DTM value (format 303 or 102) lies after a format-303 reference, such as the document date in DTM+137. A 102 day lies after it when it begins after it — a later German calendar day.
dtm_start_utc_min
UTC epoch minutes at which a DTM value begins: the instant itself for format 303 (CCYYMMDDHHMM, UTC), the German midnight that starts the day for format 102 (CCYYMMDD, a calendar day in German time).
is_mesz_utc
Returns True if the given CCYYMMDDHHMM value falls within German summer time (MESZ), False if it falls in winter time (MEZ), or Unknown if the input is invalid/too short.
is_mez_utc
Returns True if the given CCYYMMDDHHMM value falls within German winter time (MEZ).
parse_dtm303
Parse EDIFACT DTM format 303 (CCYYMMDDHHMM, already UTC per BDEW convention) into UTC epoch minutes. Any timezone suffix (e.g. +00, UTC) is ignored — BDEW values are always UTC.