API Reference › Date › Date.weekday
method

Date.weekday

Date.weekday(date) -> int

The day of the week of a Date, as 0 (Sunday) through 6 (Saturday). Useful for weekly events or daily-reward streaks.

Example

program Demo {
  handler Step phase Update {
    let w = Date.weekday(Date.new(2000, 1, 1))  # 6 (Saturday)
  }
}
← All symbols