weekday_index

Function weekday_index 

Source
fn weekday_index(dt: &DateTime<Utc>) -> usize
Expand description

Converts a chrono::DateTime<Utc> object’s weekday to a 0-indexed integer.

This function maps chrono::Weekday values (where Monday is 1, Sunday is 7) to a 0-indexed system (Monday = 0, Sunday = 6).

§Arguments

  • dt: A reference to a DateTime<Utc> object.

§Returns

A usize representing the weekday index (0 for Monday, …, 6 for Sunday).