Skip to content

Add support to UtcDateTime#1844

Merged
gwenn merged 1 commit into
masterfrom
utc_datetime
May 10, 2026
Merged

Add support to UtcDateTime#1844
gwenn merged 1 commit into
masterfrom
utc_datetime

Conversation

@gwenn

@gwenn gwenn commented May 10, 2026

Copy link
Copy Markdown
Collaborator

Fix #1843

@gwenn gwenn merged commit 2bb1bca into master May 10, 2026
16 of 17 checks passed
@gwenn gwenn deleted the utc_datetime branch May 10, 2026 07:36
Comment thread src/types/time.rs
#[inline]
fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self> {
value.as_str().and_then(|s| {
Self::parse(s, &PRIMITIVE_DATE_TIME_FORMAT)

@LikeLakers2 LikeLakers2 May 10, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thank you!

A little note: I would've recommended using UTC_DATE_TIME_FORMAT here (in the FromSql impl), as the format supports a Z at the end - which for ISO8601 or RFC3339 timestamps means "this timestamp is explicitly in the UTC timezone without any offset".

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

See #1859

@gwenn gwenn mentioned this pull request Jun 14, 2026
gwenn added a commit that referenced this pull request Jun 14, 2026
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.

Please add support for converting time::UtcDateTime to/from SQL values under the time feature

2 participants