ext-time 0.4.0

A Rust library that extends the time crate with additional useful methods for time manipulation and formatting
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use time::Weekday;

/// start from 0
pub fn weekday_to_u8(weekday: Weekday) -> u8 {
    match weekday {
        Weekday::Monday => 0,
        Weekday::Tuesday => 1,
        Weekday::Wednesday => 2,
        Weekday::Thursday => 3,
        Weekday::Friday => 4,
        Weekday::Saturday => 5,
        Weekday::Sunday => 6,
    }
}