Skip to main content
cowboy_sdk.std.calendar turns block time into calendar dates and back. A day is its number since 1970-01-01 (UTC), and a time is block-time milliseconds, as runtime.get_timestamp_ms() returns it. Everything is integer arithmetic, so every validator computes the same date.
Constants: DAY_MS, HOUR_MS, MINUTE_MS, WEEK_DAYS. To arm a timer for a time next_at returns, convert it to a height with std.clock.