Skip to main content

Module local

Module local 

Source
Expand description

Local wall-clock times and dates: the string(5) and string(10) fields OCPI uses for opening hours and tariff restrictions.

These are the only values in OCPI that are not in UTC. Both RegularHours and TariffRestrictions say the same thing: “in local time, the time zone is defined in the time_zone field of the Location”. Modelling them as parsed hour/minute and year/month/day rather than as opaque strings is what lets tariffs evaluate a restriction like “weekdays 09:00–18:00” against a session that crosses a daylight-saving boundary.

Structs§

InvalidLocalDate
Why a string is not a YYYY-MM-DD date.
InvalidLocalTime
Why a string is not an HH:MM time of day.
LocalDate
A local calendar date, YYYY-MM-DD.
LocalParts
A wall-clock reading: the date, the time of day, and the day of the week.
LocalTime
A wall-clock time of day, HH:MM in 24-hour form with leading zeros.