laminas-api-tools / api-tools

Laminas API Tools module for Laminas
https://api-tools.getlaminas.org/documentation
BSD 3-Clause "New" or "Revised" License
37 stars 19 forks source link

OAuth2 expiration time is wrong, when using different timezone in MySQL #44

Open michalbundyra opened 4 years ago

michalbundyra commented 4 years ago

Actually function strtotime is always returning time in UTC, because there isn't timezone defined. This make sense, but it's causing troubles with expiration in different timezones (GMT+X).

Question is , how to deal with it. I can set expiration time in config, but it took me long time to find the root cause of this.


Originally posted by @Ivan-Prism at https://github.com/zfcampus/zf-apigility/issues/141

michalbundyra commented 4 years ago

My suggestion is to use native SQL function, instead of counting by PHP - which is much more simple imo.


Originally posted by @Ivan-Prism at https://github.com/zfcampus/zf-apigility/issues/141#issuecomment-149638445