Alex. Account Closed Impact 5 Jan 9, 2007 1K views 5 replies #1 is there a way to request gmt time, or do you need to manually increment the hours?
Matthew. VIP Member VIP โ 15 โ Impact 89 Jan 9, 2007 #2 You can change the timezone by using the date function however this is repetitive and unnecessary. You can use a function called putenv to change the server time. Example: PHP: putenv("TZ=Europe/London"); // Below would output GMT time: // echo date('h:i:s'); Add it to the top of your script or before any time/date functions that will need to use the new timezone. Matt. Last edited: Jan 9, 2007
You can change the timezone by using the date function however this is repetitive and unnecessary. You can use a function called putenv to change the server time. Example: PHP: putenv("TZ=Europe/London"); // Below would output GMT time: // echo date('h:i:s'); Add it to the top of your script or before any time/date functions that will need to use the new timezone. Matt.
Alex. Account Closed Impact 5 Jan 10, 2007 #3 when you say change, do you mean convert the time php reads from the server to gmt? not actually changing the physical server time
when you say change, do you mean convert the time php reads from the server to gmt? not actually changing the physical server time
Matthew. VIP Member VIP โ 15 โ Impact 89 Jan 10, 2007 #4 By change i mean that code will actually change the timezone for the length of the scripts execution (it then reverts back) It doesn't technically change anything, but you get the idea. do you mean convert the time php reads from the server to gmt Click to expand... In a few words yes.
By change i mean that code will actually change the timezone for the length of the scripts execution (it then reverts back) It doesn't technically change anything, but you get the idea. do you mean convert the time php reads from the server to gmt Click to expand... In a few words yes.
Daniel15 Established Member โ 15 โ Impact 8 Jan 10, 2007 #6 Alternatively, you can use the gmdate function: Code: <?php gmdate('h:i:s A'); ?>