Skip to content

Comments

Use always internal parsing for iso date/times#413

Open
elacour wants to merge 1 commit intobestpractical:stablefrom
Easter-eggs:6.0/parse-unknown-isodate
Open

Use always internal parsing for iso date/times#413
elacour wants to merge 1 commit intobestpractical:stablefrom
Easter-eggs:6.0/parse-unknown-isodate

Conversation

@elacour
Copy link
Contributor

@elacour elacour commented Feb 13, 2026

When using RT "unknown" date format, external perl modules are used and fails:
* Time::ParseDate fail to parse iso format and produce wrong date/time,
* DateTime::Format::Natural claims string isn't parseable.

This is a problem when updating RT DateTime CF from REST where iso8601 is recommended. _CanonicalizeValueDateTime parse input as "unknown" and produces wrong dates.

When using RT "unknown" date format, external perl modules are used and
fails:
    * Time::ParseDate fail to parse iso format and produce wrong date/time,
    * DateTime::Format::Natural claims string isn't parseable.

This is a problem when updating RT DateTime CF from REST where iso8601
is recommended. _CanonicalizeValueDateTime parse input as "unknown" and
produces wrong dates.
@elacour
Copy link
Contributor Author

elacour commented Feb 13, 2026

Before this PR:

$ ./test.pl
Testing with "2026-02-13T17:16:35Z"

Parsed as "unknown" with Time::ParseDate: 2026-02-12 23:00:00

[900183] [Fri Feb 13 17:38:23 2026] [warning]: Couldn't parse date '2026-02-13T17:16:35Z' by DateTime::Format::Natural
Parsed as "unknown" with DateTime::Format::Natural: 2026-02-12 23:00:00

Parsed as "iso": 2026-02-13 17:16:35

@elacour
Copy link
Contributor Author

elacour commented Feb 13, 2026

Maybe adding a chapter on REST2 doc about doc formats would be nice ?

@cbrandtbuffalo
Copy link
Member

  • Time::ParseDate fail to parse iso format and produce wrong date/time,

I'm inclined to try to get a fix in Time::ParseDate rather than covering up a bug in the RT code. There is actually a PR with a fix: muir/Time-modules#10, but the module is looking for a new maintainer. I'll look into that and see what the options are.

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.

2 participants