Bug 24288 – std time handling SUX

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2023-12-18T22:24:49Z
Last change time
2024-12-01T16:42:07Z
Assigned to
No Owner
Creator
crazymonkyyy
Moved to GitHub: phobos#10539 →

Comments

Comment #0 by crazymonkyyy — 2023-12-18T22:24:49Z
theres more docs than I've ever written across 6 maybe 7 files it took me an HOUR to write this line of code; `int min=((Clock.currStdTime/10_000_000)/60)%(60*24);` the unit hnsecs is made up, im still unsure if its correct, etc etc etc I just wanted the current hour and minute, why is there so much code between me and the solution?
Comment #1 by nick — 2023-12-20T13:39:18Z
This is what I came up with, not sure if there's a better way: const tod = cast(TimeOfDay) Clock.currTime; (tod.hour * 60 + tod.minute).writeln();
Comment #2 by crazymonkyyy — 2023-12-20T23:08:43Z
im pretty sure the intended way is ```d int min=Clock.currTime.minute; int hour=Clock.currTime.hour; ``` but to find that you need to read docs across 3 different pages, and good luck finding the words I was reading given that its all generated docs and that api isn't great anyway Its so much code, it needs someone who will delete 95% of the lines
Comment #3 by dlang-bot — 2023-12-21T14:53:49Z
@ntrel created dlang/phobos pull request #8867 "[std.datetime] Tweak docs" mentioning this issue: - [std.datetime] Tweak docs Add links to package.d. Tweak formatting for SysTime, use PANEL. Use REF_SHORT after first reference. List TimeOfDay cast target. Move currTime link to See Also. Fix anchor for currTime - need `.` prefix before fully-qualified names. Part of Issue 24288. https://github.com/dlang/phobos/pull/8867
Comment #4 by dlang-bot — 2023-12-29T19:47:39Z
dlang/phobos pull request #8867 "[std.datetime] Tweak docs" was merged into master: - 5e93d4f9c9f0a17fdf6f222c9ff8153b16aa01c1 by Nick Treleaven: [std.datetime] Tweak docs Add links to package.d. Tweak formatting for SysTime, use PANEL. Use REF_SHORT after first reference. List TimeOfDay cast target. Move currTime link to See Also. Fix anchor for currTime - need `.` prefix before fully-qualified names. Part of Issue 24288. https://github.com/dlang/phobos/pull/8867
Comment #5 by flyboynw — 2024-10-18T08:23:12Z
Their was a PR for this but the bot didn't resolve it. Resolving manually.
Comment #6 by robert.schadek — 2024-12-01T16:42:07Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10539 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB