This topic is locked

To get the local date if your database is hosted in a different country / timezone

4/28/2022 10:07:28 PM
PHPRunner Tips and Tricks
C
Cornelius Smit author

select * from mydatabase WHERE mydate = DATE(convert_tz(NOW(),@@session.time_zone,'+10:00'))

P
ppradhan@live.com 4/29/2022

@Cornelius,
in the 'After Application Initialized' use this code with your desired timezone.

date_default_timezone_set("America/New_York");

like I use this for Nepal's timezone: date_default_timezone_set("Asia/Kathmandu");