JPMG Posted July 30, 2020 Share Posted July 30, 2020 I am currently using a product called PhPRunner. The aim is to set the default value of a field to the current time in (Africa/Johannesburg) zone. Got this to give the time: Date("H:i:s") but it is not in (Africa/Johannesburg) zone Thanks Quote Link to comment https://forums.phpfreaks.com/topic/311247-newbie-trying-to-format-date/ Share on other sites More sharing options...
requinix Posted July 30, 2020 Share Posted July 30, 2020 It's off by two hours, right? Because PHP is normally set to UTC time. date_default_timezone_set Or if you're based in that timezone and want everything to always be according to that, change the date.timezone value in your php.ini to say Africa/Johannesburg. (And restart your web server and/or PHP.) Quote Link to comment https://forums.phpfreaks.com/topic/311247-newbie-trying-to-format-date/#findComment-1580189 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.