#date #date-time #chrono #date-utilities #date-utils

perDiem

A comprehensive collection of timezone-naive date and datetime utilities

11 releases

0.1.64 Apr 5, 2024
0.1.63 Feb 22, 2024
0.1.5 Nov 9, 2023
0.1.4 Oct 27, 2023
0.0.2 Oct 26, 2023

#109 in Date and time

Download history 237/week @ 2024-02-16 241/week @ 2024-02-23 42/week @ 2024-03-01 2/week @ 2024-03-08 2/week @ 2024-03-15 5/week @ 2024-03-29 92/week @ 2024-04-05

846 downloads per month

MIT license

82KB
1.5K SLoC

perDiem

0.1.61 to 0.1.64 Patch notes:

Message me on Discord @ dtimer for any feedback or suggestions

Adds:

OrdinalDate struct
increase and decrease ordinally functions
to_OrdinalDate
Finally adding decrease function for Date and DateTime(decrease_ordinally_as_new and decrease_ordinally)
Improves documentation a ton

Fixes/Changes:

Changed the start year for .new() for Date, DateTime, and OrdinalDate to 0, (Was 1)
Changed some doc descriptions
Removed unnecessary checks due to type restrictions
Made 24 an invalid hour(Should be hour 0)

Normal README:

The Date struct:

Fields:

day: i8
month: i8
year: i16
Implementations

The DateTime struct:

Fields:

second: i8
minute: i8
hour: i8
day: i8
month: i8
year: i16
Implementations

The TimeDifference struct:

Used to represent the difference between Dates and DateTimes Fields:

second: i32 minute: i32
hour: i32
day: i32
month: i32
year: i32
Implementations

The TimeSpan enum:

Used for increase and decrease methods(WIP)
Variants:

second: i32 minute: i32
hour: i32
day: i32
month: i32
year: i32

Dependencies

~1.6–2.4MB
~45K SLoC