ISPs, markets and time
DST-correct ISP arithmetic in uftp: day grids of 92, 96 or 100 quarter-hours, market checks for ISP length and time zone, and the time rules of UFTP §3.5.On this page
ISPs#
An IspSpan is a first ISP and a count; ISPs start at 1. A DayGrid is one day in one IANA zone cut into ISPs of one length:
let grid = DayGrid::new("2026-10-25".parse()?, "Europe/Amsterdam".parse()?, IspDuration::PT15M)?;
assert_eq!(grid.count(), 100); // the day the clocks go back
let (start, end) = grid.interval(93)?; // ISP 93 as two instants
assert_eq!(grid.isp_at(start), Some(93));Every message with ISPs is checked against its grid. An ISP addressed twice is ISP conflict, and one past the end of the day is ISPs out of bounds.
The UFTP schema allows only the time-zone areas Africa, America, Australia, Europe and Pacific, so Asia/Tokyo is refused.
The market#
The ISP length and the time zone are agreed per market. Market::check compares a message with them:
- another ISP length is ISP duration rejected;
- a zone with other UTC offsets on that day is Time zone rejected. Europe/Berlin passes in an Amsterdam market; Europe/London does not.
A FlexSettlement carries no time zone or ISP length of its own, so its ISP numbers mean something only in the market's grid. Market::check reads them there.
The clock#
The library never reads a clock. Pass now:
message.check_time(now)?;- Period out of bounds: a FlexRequest, FlexOffer, FlexOrder, D-Prognosis or FlexReservationUpdate whose day is over in its own time zone.
- ExpirationDateTime out of bounds: a FlexRequest or FlexOffer that has expired.
Even without a clock, a FlexRequest or FlexOffer whose expiration lies after the end of its last ISP is refused when it is decoded.