Skip to content

add to_primitive for OffsetDateTime#771

Closed
PacificBird wants to merge 1 commit intotime-rs:mainfrom
PacificBird:to_primitive
Closed

add to_primitive for OffsetDateTime#771
PacificBird wants to merge 1 commit intotime-rs:mainfrom
PacificBird:to_primitive

Conversation

@PacificBird
Copy link
Copy Markdown

When working with my legacy database at work while trying to have a sensible internal API for dealing with times I need to downcast OffsetDateTimes to PrimitiveDateTimes constantly. I was very surprised to find this isn't built-in since it is simple but needlessly verbose to achieve with the existing API. I cannot express how much nicer my code will become with this method available. Being able to go from wrapping it in a free function to a method call would be lovely.

@jhpratt
Copy link
Copy Markdown
Member

jhpratt commented Feb 27, 2026

For the love of god, search before opening a PR! You're wasting everyone's time by not doing so.

#369
#390
#395
#454
#458
#553
#658
#673
#705

@jhpratt jhpratt closed this Feb 27, 2026
@jhpratt jhpratt added the C-invalid Category: no issue exists or the issue cannot be reproduced label Feb 27, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.0%. Comparing base (ac010e8) to head (5aca771).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
time/src/offset_date_time.rs 0.0% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main    #771     +/-   ##
=======================================
- Coverage   94.2%   94.0%   -0.2%     
=======================================
  Files         96      97      +1     
  Lines      10732   11139    +407     
=======================================
+ Hits       10107   10473    +366     
- Misses       625     666     +41     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-invalid Category: no issue exists or the issue cannot be reproduced

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants