Add now_local and now_utc for DicomDate, DicomDate and DicomDateTime#700
Merged
Enet4 merged 13 commits intoEnet4:masterfrom Nov 14, 2025
Merged
Add now_local and now_utc for DicomDate, DicomDate and DicomDateTime#700Enet4 merged 13 commits intoEnet4:masterfrom
Enet4 merged 13 commits intoEnet4:masterfrom
Conversation
bowenxuuu
reviewed
Oct 4, 2025
bowenxuuu
reviewed
Oct 4, 2025
Enet4
reviewed
Oct 9, 2025
Owner
Enet4
left a comment
There was a problem hiding this comment.
This is much appreciated!
- Instead of using "today" for the date I decided to use "now" for all methods. Please let me know if you still wanna go for today.
OK, I just looked and even the today methods in chrono are deprecated, so we'd better not use them from the start!
- I created a variant for the local time and for utc.
Makes sense. DICOM is particularly quirky here, because many key attributes are split by date and time, and the timezone cannot be written when this happens. There may be even more ways to assist users when working with DICOM dates and times, but offering these possibilities should be a step in the right direction.
- I am not sure how I should setup the tests here. Should I look into mocking the chronos library or do you have another idea on how to handle it?
I think it's OK that we test this by issuing a now date-time via chrono to serve as a reference. Then for the date-time output we would check for differences with the reference so that they are within an acceptable margin (like 1 second or so).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementation of #691
Looking forward to your feedback!