I want to get current time of US/Eastern timezone. How would I achieve that. Show I have tried following code but it is displaying my system's time.
I am using this script with flash so commented out 'print' line.
halfer 19.6k17 gold badges92 silver badges175 bronze badges asked Dec 16, 2010 at 0:34
2
Seems to work here (in Berlin):
answered Dec 16, 2010 at 0:44
mikumiku 175k46 gold badges303 silver badges307 bronze badges 3
or if you are using php 5.4 and above
Ram Sharma 8,5367 gold badges44 silver badges55 bronze badges answered Mar 13, 2014 at 23:20
1 http://www.php.net/manual/en/timezones.php Looks like the EDIT this probably won't fix your problem, but you should do it anyway. Being deprecated means that they could remove it in the future. answered Dec 16, 2010 at 0:44
RobertRobert 6,3242 gold badges23 silver badges25 bronze badges The easiest way is probably to use
Saty 22.3k7 gold badges30 silver badges49 bronze badges answered Dec 16, 2010 at 0:45
2
I just use
Seems to work perfectly for me on my game that I'm working on. Mind you if you want to use it just remove the $ir['laston'] and it should work no problem answered Nov 30, 2017 at 10:55
2 What is PHP time zone?The default timezone for PHP is UTC regardless of your server's timezone. This is the timezone used by all PHP date/time functions in your scripts.
Where is PHP timezone set?8 Answers. Go to your phpinfo() page and search for Loaded Configuration File and open the php. ini file mentioned under that section.. Change the default timezone settings by adding your new timezone by modifying this line: date. timezone=Asia/Kolkata .. Save the php. ... . Restart the Apache server.. How can I modify the PHP timezone setting for my website?Open Hosting → Manage → PHP Configuration page. There, open the PHP options tab and edit the date. timezone value: If you are not sure which time zone to insert, check the Time Zone Map.
How do I set default timezone?The date_default_timezone_set() function sets the default timezone used by all date/time functions in the script.
|