Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fixchrono::DateTime<Utc> tests#1170

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
sfackler merged 1 commit intorust-postgres:masterfromallan2:chrono-test
Aug 16, 2024

Conversation

allan2
Copy link
Contributor

test_date_time_params andtest_with_special_date_time_params could fail when run with a non-UTC system time zone.
I encountered these failing tests when writing the tests for jiff.

In Postgres, if no time zone is stated in the input string, then it is assumed to be in system time.[1] This means that in these tests, a correctly parsedDateTime<Utc> could be compared to an incorrectly offset time.

The offset component is now included in the test strings of these tests. This component is already present in the test strings fortime::OffsetDateTime.

[1]Postgres docs:

For timestamp with time zone, the internally stored value is always in UTC (Universal Coordinated Time, traditionally known as Greenwich Mean Time, GMT). An input value that has an explicit time zone specified is converted to UTC using the appropriate offset for that time zone. If no time zone is stated in the input string, then it is assumed to be in the time zone indicated by the system'sTimeZone parameter, and is converted to UTC using the offset for the timezone zone.

`test_date_time_params` and `test_with_special_date_time_params` could fail when run with a non-UTC system time zone.In Postgres, if no time zone is stated in the input string, then it is assumed to be in system time.This means that in these tests, a correctly parsed `DateTime<Utc>` could be compared to an incorrectly offset time.The offset component is now included in the test strings of these tests. This component is already present in the test strings for `time::OffsetDateTime`.
@sfacklersfackler merged commit2e6b7df intorust-postgres:masterAug 16, 2024
@sfackler
Copy link
Collaborator

Thanks!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@allan2@sfackler

[8]ページ先頭

©2009-2025 Movatter.jp