clock ===== .. py:module:: clock .. autoapi-nested-parse:: German local time (CET/CEST) from UTC, without a timezone database. EU rule: summer time runs from the last Sunday in March, 01:00 UTC, to the last Sunday in October, 01:00 UTC. Functions take time.gmtime() tuples: (year, month, mday, hour, minute, second, weekday [Monday = 0], yearday). Attributes ---------- .. autoapisummary:: clock.MIN_VALID_YEAR clock.SECONDS_PER_DAY Functions --------- .. autoapisummary:: clock.is_summer_time clock.local_minutes clock.local_hhmm clock.parse_iso clock.local_date_hhmm Module Contents --------------- .. py:data:: MIN_VALID_YEAR :value: 2024 .. py:data:: SECONDS_PER_DAY :value: 86400 .. py:function:: is_summer_time(utc) Whether German summer time (CEST) applies at a UTC time. :param utc: A `time.gmtime()` tuple. :returns: 00 UTC. :rtype: True between the last Sundays of March and October, 01 .. py:function:: local_minutes(utc) Minutes since local midnight, or None if the clock is not set. .. py:function:: local_hhmm(utc) Local wall-clock time as "HH:MM", or None if the clock is not set. .. py:function:: parse_iso(text) Parse an ISO 8601 time into a UTC time tuple. Accepts times like "2026-09-26T18:00:00+02:00", "...Z" or without zone (taken as UTC), as Home Assistant's attributes contain them. :param text: The time as text. :returns: A `time.gmtime()`-like tuple in UTC, or None if it cannot be read. .. py:function:: local_date_hhmm(utc) Local date and time as "26.09. 18:00", or None for an unset time.