Skip to content

Fix codestudio wizard in timezones that are UTC+N#1964

Open
larowlan wants to merge 1 commit intoacquia:mainfrom
larowlan:patch-1
Open

Fix codestudio wizard in timezones that are UTC+N#1964
larowlan wants to merge 1 commit intoacquia:mainfrom
larowlan:patch-1

Conversation

@larowlan
Copy link

Motivation

Attempting to use the wizard in any timezone that is ahead of UTC throws a 400 bad request from gitlab because of date handling that doesn't take into account the default timezone setting in PHP
400 Bad request - Expiration date must be before 2027-02-17

Proposed changes

Makes sure the date set is in UTC

Alternatives considered

Testing steps

Edit php.ini and set your timezone to something ahead of the international date line - e.g.

date.timezone = Australia/Brisbane

Run the cs:wizard command before UTC ticks over (e.g. before 10 am in the case of Brisbane).

Get the above error.

Change your timezone to UTC and it works.

Fix avoids need to do that

Copy link
Contributor

@danepowell danepowell left a comment

Choose a reason for hiding this comment

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

Great find, thanks a lot for the PR.

Seems like you might need to use DateTimeZone; to make this work.

If you can get tests passing, I'd be very happy to merge this.

@larowlan
Copy link
Author

yeah I did this in the github UI, needs a leading \ to make it global

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