Skip to content
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

Fix parsing for zone offset seconds #1639

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix parsing for zone offset seconds #1639

wants to merge 1 commit into from

Conversation

djc
Copy link
Member

@djc djc commented Dec 11, 2024

%::z is defined as:

Offset from the local time to UTC with seconds.

So it seems like we should support this better?

Fixes #1629.

// mismatching colon expectations
assert!(parse("Aug 09 2013 23:54:35 -09:00:00", "%b %d %Y %H:%M:%S %::z").is_err());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems strange that this errored?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests are just weird, and I had to fix them endless times during rebases of the branches where I fixed this offset parsing bug.

Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 97.14286% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.90%. Comparing base (8b86349) to head (db464fa).

Files with missing lines Patch % Lines
src/format/scan.rs 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1639      +/-   ##
==========================================
- Coverage   91.11%   90.90%   -0.21%     
==========================================
  Files          37       37              
  Lines       17137    17137              
==========================================
- Hits        15614    15579      -35     
- Misses       1523     1558      +35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pitdicker
Copy link
Collaborator

Sorry, I unfortunately don't have time at the moment 😞.

A complete fix with tests for this category of errors is in #1083.

@djc
Copy link
Member Author

djc commented Dec 13, 2024

@pitdicker thanks for the quick response, and the pointer! Going to have a look at your PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chrono stftime parsing "%::z" with seconds (+00:00:00)
2 participants