Skip to content

std.time.epoch: API naming fixes and clean-ups #24176

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

wooster0
Copy link
Contributor

  • Use consistent date format in documentation comments.
  • Deprecate epoch_year: if anything it should be called year
    (though that's difficult due to aliasing) but I couldn't find anyone
    using this constant and I don't see how it would be useful unless you
    want to do time calculation on your own, but you can instead
    just use the functions provided by the structure.
  • Deprecate secs_per_day: this already exists in std.time.
  • Remove all @as in the file. All were unnecessary.
  • Fix bad naming of structure names and fields.
    YearAndDay sounds like it's the year of the time and the day of the
    time, when actually it is the year of the time and the number of the
    days into the day, so that should definitely be plural.
  • Fix redundant words in names. The entire file concerns itself with the
    Unix epoch so no need to repeat that.

@wooster0 wooster0 force-pushed the epoch branch 2 times, most recently from 8b0f3f2 to e9e11db Compare June 14, 2025 02:04
wooster0 added 3 commits June 14, 2025 12:30
- Use consistent date format in documentation comments.
- Deprecate `epoch_year`: if anything it should be called `year`
  (though that's difficult due to aliasing) but I couldn't find anyone
  using this constant and I don't see how it would be useful unless you
  want to do time calculation on your own, but you can instead
  just use the functions provided by the structure.
- Deprecate `secs_per_day`: this already exists in `std.time`.
- Remove all `@as` in the file. All were unnecessary.
- Fix bad naming of structure names and fields.
  `YearAndDay` sounds like it's the year of the time and the day of the
  time, when actually it is the year o the time and the number of the
  days into the day, so that should definitely be plural.
- Fix redundant words in names. The entire file concerns itself with the
  Unix epoch so no need to repeat that.
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.

1 participant