Skip to content

[WDM] Assume Europe/London for update fetching time params.#518

Merged
neprune merged 1 commit into
masterfrom
fix-wdm-timezone
Jun 15, 2026
Merged

[WDM] Assume Europe/London for update fetching time params.#518
neprune merged 1 commit into
masterfrom
fix-wdm-timezone

Conversation

@neprune

@neprune neprune commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@neprune neprune requested a review from dracos June 9, 2026 19:02

@dracos dracos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm afraid this doesn't do anything, because time_zone is used for parsing with Strptime, not formatting:

$ bin/cron-wrapper perl -MIntegrations::WDM -e'
my $e = Integrations::WDM->new;
print $e->format_datetime( $e->parse_w3c_datetime("2026-06-12T12:00:00Z") );'
2026-06-12 12:00:00

Probably easiest if parse_w3c_datetime is changed to always change the timezone of what it's worked out (which could be a UTC timestamp or a local one already):

    my $dt = $w3c->parse_datetime($dt_string);
    $dt->set_time_zone('Europe/London');

That then gives:

$ bin/cron-wrapper perl -MIntegrations::WDM -e'
my $e = Integrations::WDM->new;
print $e->format_datetime( $e->parse_w3c_datetime("2026-06-12T12:00:00Z") );'
2026-06-12 13:00:00

@neprune neprune force-pushed the fix-wdm-timezone branch from 3db0121 to cac95b9 Compare June 12, 2026 15:22
@neprune

neprune commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

I'm afraid this doesn't do anything, because time_zone is used for parsing with Strptime, not formatting:

$ bin/cron-wrapper perl -MIntegrations::WDM -e'
my $e = Integrations::WDM->new;
print $e->format_datetime( $e->parse_w3c_datetime("2026-06-12T12:00:00Z") );'
2026-06-12 12:00:00

Probably easiest if parse_w3c_datetime is changed to always change the timezone of what it's worked out (which could be a UTC timestamp or a local one already):

    my $dt = $w3c->parse_datetime($dt_string);
    $dt->set_time_zone('Europe/London');

That then gives:

$ bin/cron-wrapper perl -MIntegrations::WDM -e'
my $e = Integrations::WDM->new;
print $e->format_datetime( $e->parse_w3c_datetime("2026-06-12T12:00:00Z") );'
2026-06-12 13:00:00

Sorry, not my brightest moment. Thanks for laying it out clearly.

I think this change will also affect the timestamps we send out for post_update and raise_defect. Couldn't find any docs on this (WSDL included) but would be odd if these also didn't assume the same timezone so hopefully fine.

This also affects the timestamps sent in 'post_update' and 'raise_defect'.
@neprune neprune force-pushed the fix-wdm-timezone branch from cac95b9 to ee85398 Compare June 12, 2026 15:26
@neprune neprune requested a review from dracos June 12, 2026 15:29

@dracos dracos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks; updated_datetime comes through from FMS with a local timezone (in perllib/Open311.pm) (so +01:00 at the moment), so I assume will be unchanged by setting the timezone to the same thing.

@neprune neprune merged commit ee85398 into master Jun 15, 2026
8 checks passed
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