#date-time #utc #string #timestamp #convert

utc-datetime

Return timestamp of UTC datetime,Convert time string to UTC datetime

15 releases

0.1.17 Nov 16, 2021
0.1.16 Nov 15, 2021
0.1.15 Jun 26, 2021
0.1.14 Apr 28, 2020

#344 in Date and time

Download history 3/week @ 2024-02-23 3/week @ 2024-03-01 57/week @ 2024-03-29

57 downloads per month

MIT license

10KB
146 lines

The main function

impl UtcDatetime{
    fn new(year:u16,month:u8,day:u8,hour:u8,minute:u8,second:u8)->Result<UTCDatetime, IllegalTimeError>;
    fn timestamp(&self)->Result<u32,IllegalTimeError>;
    fn weekday(&self)->u8;
    fn from_string(time_str:&str)->Result<UTCDatetime, IllegalTimeError>;
}

The UTCDatetime structure derives PartialEq and PartialOrd, you can directly use <,>, ==, <=,>=,!= for comparison.

No runtime deps