There is No date time library in STD?

it seems the zig standard library doesn’t seem to have date time module.

  • There any plans on adding it?
  • What is community’s go to library for date time?

What kind of features you want from date time library?
I used zeit by @rockorager and it solved problems I had maybe it will fit your needs as well.

3 Likes

I think this might be because dates and Unicode are both fields of complexity that are bottomless.

The rules for DST (Daylight Saving Time) are changed by various governments, and these rules cannot be hardcoded into programs. The entire computing world relies on an authoritative source called the IANA Time Zone Database. This database needs to be continuously updated to reflect historical changes in time zone offsets, DST rules, and even time zone names in different countries. Your operating system and programming language environment must regularly update this database; otherwise, time calculations will be incorrect.

Zig has already decided not to support unicode in std, and I believe there are similar reasons for not supporting more complex date formats.

3 Likes

Hare solves this (in part) by offloading timezone information to the system’s tzdb: Chronology in Hare

1 Like

This is exactly what zeit does (link above). On Windows, it uses the OS timezones as well - the only difference I’ve seen between the tzdb and Windows is some of the naming / designations are slightly different.

There any plans on adding it?

#8396

If I only need to print some timestamps I use this:

Otherwise I would use one of the third party libraries.