-
Notifications
You must be signed in to change notification settings - Fork 291
Initial implementation of ZonedDateTime Module #6393
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
base: master
Are you sure you want to change the base?
Conversation
…eed many resource
…608/dafny into local-datetime-duration
… Duration for now
Local datetime duration
…move file description content from md to corresponding files
…pdate related implementation and test cases
Local datetime duration
…dafny into local-datetime-duration
f646690 to
0b5f7cb
Compare
Local datetime duration
e601084 to
749df82
Compare
|
@robin-aws Hi Robin, I found that I couldn't edit the whole PR to show only the diff between local-datetime-duration and zoned-date-time since this PR is asking to be merged into master branch. However, I squashed all my commits into one: |
Initial implementation of ZonedDateTime Module
File Organization
This PR has added function implementations based on #6389
Function implementation:
Test and Example code:
Updated Documentation:
Declaration about the logic in ZonedDateTime
Hi, Robin @robin-aws. Zoned Date Time now only has DST handling in Of() function as the user will specify the zone id in the parameter. Arithmetic functions (Plus*() & Minus*()) and With*() functions don't have DST handling as these functions are offset-based and we don't ask users to specify zone id in these functions.
Issues about tests in ZonedDateTimeExamples
Some test functions such as TestFormatISO8601() had Verification out of resource error displayed on IDE before adding {:resource_limit 5000000} at the function head. However, when executing Test Commands all the tests passed even without specifying the resource limit.
We need to see if this result is acceptable. If it is, we will keep this implementation in this version.
The test case that has Verification out of resource error displayed on IDE before specifying the resource limit:
method {:test} {:resource_limit 5000000} TestFormatISO8601() { var ldt := LDT.LocalDateTime(2023, 6, 15, 14, 30, 45, 123); var zdt := ZDT.ZonedDateTime(ldt, "Asia/Shanghai", 480); var isoFormat := ZDT.Format(zdt, ZDT.DateFormat.ISO8601); AssertAndExpect(isoFormat == "2023-06-15T14:30:45.123+08:00"); }