std.time missing minute constants.
Zig Version
0.13.0
Steps to Reproduce and Observed Behavior
- Install Zig 0.13.0 (or master branch).
- Go to the source for
std.timeexample. - Look at line
117.
You'll notice there are no division for minutes.
Expected Behavior
Would expect to see a block for minutes and possibly hours.
// Divisions of a minute.
pub const min_per_hour = 60;
pub const min_per_day = min_per_hour * 24;
pub const min_per_week = min_per_day * 7;
I suppose the argument for or against this could be that 24 is an approximation of hours in a day since the number changes on a microscopic level annually due to the universe expending, but other constants do that and it's universally accepted that 24 works.
The most reasonable counter-argument for this is that nothing in std.time accepts a number in minutes. The existing constants, ns, us, ms, and sec are all numeric constants that are actually useful to pass into functions defined in std.time
min_per_day and min_per_week are both very context and calendar specific
min_per_hour is needed rare enough, along with what truemedian said, i dont think is a strong argument for it to be in std