Skip to content

Commit 01b1348

Browse files
Kenoclaude
andauthored
stdlib/Dates: Fix doctest regex to handle DateTime with 0 microseconds (#58981)
The `now(UTC)` doctest can fail when the DateTime has exactly 0 milliseconds, as the output format omits the fractional seconds entirely (e.g., "2023-01-04T10:52:24" instead of "2023-01-04T10:52:24.000"). Update the regex filter to make the milliseconds portion optional by using `(\\.\\d{3})?` instead of `\\.\\d{3}`. Fixes CI failure: https://buildkite.com/julialang/julia-master/builds/49144#0197fd72-d1c6-44d6-9c59-5f548ab98f04 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Keno Fischer <Keno@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3f9ba7f commit 01b1348

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/Dates/src/conversions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Return a `DateTime` corresponding to the user's system time as UTC/GMT.
8585
For other time zones, see the TimeZones.jl package.
8686
8787
# Examples
88-
```jldoctest; filter = r"\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}" => "2023-01-04T10:52:24.864"
88+
```jldoctest; filter = r"\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?" => "2023-01-04T10:52:24.864"
8989
julia> now(UTC)
9090
2023-01-04T10:52:24.864
9191
```

0 commit comments

Comments
 (0)