Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

take timezone into account #83

Merged
merged 2 commits into from Feb 25, 2017
Merged

take timezone into account #83

merged 2 commits into from Feb 25, 2017

Conversation

basz
Copy link
Collaborator

@basz basz commented Feb 25, 2017

No description provided.

@@ -158,15 +159,15 @@ public function getExpiresAt()
*/
public function getExpiresIn(): int
{
return $this->expiresAt->getTimestamp() - (new DateTime('now'))->getTimestamp();
return $this->expiresAt->getTimestamp() - (new DateTime('now', new DateTimeZone(date_default_timezone_get())))->getTimestamp();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would go with UTC because of changing time to winter and summertime.

@coveralls
Copy link

coveralls commented Feb 25, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling afd7efb on basz:timezone into beb8a89 on zf-fr:master.

Copy link
Collaborator

@prolic prolic left a comment

Choose a reason for hiding this comment

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

Nice. Merge when travis is green.

@coveralls
Copy link

coveralls commented Feb 25, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling 5b7b565 on basz:timezone into beb8a89 on zf-fr:master.

@prolic
Copy link
Collaborator

prolic commented Feb 25, 2017

Failed on php7

@basz
Copy link
Collaborator Author

basz commented Feb 25, 2017

that failure is due to new Date != new Date

#49

@basz basz merged commit a993ba3 into zf-fr:master Feb 25, 2017
@basz basz deleted the timezone branch February 28, 2017 12:48
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.

None yet

3 participants