I use Laravel and I deployed my application on Docker
I use carbon package for time management and I set the timezone to Asia/Tehran But now I found a problem and the time are moved forward one hour and I don’t want this one hour to move forward.
Is there a solution for me to move back one hour?
Carbon::now("Asia/Tehran"); // Asia/Tehran (+04:30)
But i need this
Carbon::now("Asia/Tehran"); // Asia/Tehran (+03:30)
2
Answers
DateTime (and so Carbon) relies on https://pecl.php.net/package/timezonedb to know which city has which offsets. You need to update it to get the latest info. If it’s not yet available you’ll need to ask the offset explitcly:
using
timezonedb
package solve your issueor simply download and install it
https://pecl.php.net/package/timezonedb/
after install add this line to
php.ini