Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Date, Time, DateTime, and PosixTz #14537

Closed
wants to merge 1 commit into from
Closed

Conversation

billzez
Copy link
Contributor

@billzez billzez commented Feb 4, 2023

I've been using this code for a few months, and decided its probably time to upstream it.

  • adds functionality provided by libc's mktime, localtime, gmtime, timegm, asctime, strftime, etc...
  • parse posix timezone strings
  • parse http "Date" fields
  • parse ISO 8601 strings

};

pub const Weekday = enum(u3) {
Sunday,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weekdays should be numbered from 1 to 7 starting with monday.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a POSIX vs ISO convention debate that I would rather not get into. These algorithms are based upon what is typically done in libc. And since Zig eventually hopes to implement it's own libc, the POSIX way made more sense to me.

@billzez billzez closed this Feb 28, 2023
This was referenced Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants