My target market is based in a very different time zone compared to where the webserver is based. Therefore, my save method timestamps Created and Modified are a lot less useful than they could be. Is there anyway that I could define a global offset for my app for those two fields whenever they are saved in the app so that the time matches my target market timezone? For example, deduct 5h from every Created record?
Share
Put this in your Config/bootstrap.php:
It’s just based on the server time and really has nothing to do with CakePHP – so just change the default timezone with PHP, and you should be good to go.
'created'and'modified'will be based on the specified timezone.