Clock and calendar reference
The 10 functions and 16 values of clock: signature, effects, phase, cost and tested examples.
Read the parts of a time value in a time zone, and ask whether a time of day has been reached.
Functions#
clock.day_of#
clock.day_of([time], [zone])
A part of a time value, read in the zone.
- Effects: none: the result depends on the arguments only.
- Phase: every bar.
- Cost: a fixed number of operations.
- Returns: a whole number.
clock.hour_of#
clock.hour_of([time], [zone])
A part of a time value, read in the zone.
- Effects: none: the result depends on the arguments only.
- Phase: every bar.
- Cost: a fixed number of operations.
- Returns: a whole number.
- Examples: Weekday mornings, A time with no zone.
clock.minute_of#
clock.minute_of([time], [zone])
A part of a time value, read in the zone.
- Effects: none: the result depends on the arguments only.
- Phase: every bar.
- Cost: a fixed number of operations.
- Returns: a whole number.
clock.month_of#
clock.month_of([time], [zone])
A part of a time value, read in the zone.
- Effects: none: the result depends on the arguments only.
- Phase: every bar.
- Cost: a fixed number of operations.
- Returns: a whole number.
clock.reached#
clock.reached([time], [zone])
True on the first bar of each date whose close is at or after the time of day, in the zone.
- Effects: none: the result depends on the arguments only.
- Phase: every bar.
- Cost: a fixed number of operations.
clock.second_of#
clock.second_of([time], [zone])
A part of a time value, read in the zone.
- Effects: none: the result depends on the arguments only.
- Phase: every bar.
- Cost: a fixed number of operations.
- Returns: a whole number.
clock.timestamp#
clock.timestamp([year], [month], [day], [hour], [minute], [second], [zone])
The time of a calendar moment, in the zone, as a time value.
- Effects: none: the result depends on the arguments only.
- Phase: every bar.
- Cost: a fixed number of operations.
- Examples: Weekday mornings, A time with no zone.
clock.week_of#
clock.week_of([time], [zone])
A part of a time value, read in the zone.
- Effects: none: the result depends on the arguments only.
- Phase: every bar.
- Cost: a fixed number of operations.
- Returns: a whole number.
clock.weekday_of#
clock.weekday_of([time], [zone])
A part of a time value, read in the zone.
- Effects: none: the result depends on the arguments only.
- Phase: every bar.
- Cost: a fixed number of operations.
- Returns: a whole number.
- Examples: Weekday mornings, Volume by weekday, A time with no zone.
clock.year_of#
clock.year_of([time], [zone])
A part of a time value, read in the zone.
- Effects: none: the result depends on the arguments only.
- Phase: every bar.
- Cost: a fixed number of operations.
- Returns: a whole number.
Values#
clock.dayclock.fridayclock.hourclock.minuteclock.mondayclock.monthclock.nowclock.saturdayclock.secondclock.sundayclock.thursdayclock.tuesdayclock.wednesdayclock.weekclock.weekdayclock.year