Current location: Hot Scripts Forums » Programming Languages » PHP » how to change GMT


how to change GMT

Reply
  #1 (permalink)  
Old 12-11-07, 10:58 PM
HolyDevil's Avatar
HolyDevil HolyDevil is offline
Newbie Coder
 
Join Date: Aug 2007
Location: Terengganu, Malaysia
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
how to change GMT

PHP Code:

$time=date("g:ia"); 

when i display the result, it show that the time was in GMT but my place is GMT+08..
i already check my notebook time zone and it was GMT+08..how i can change it to the GMT+08 format???

Last edited by Christian; 12-12-07 at 01:30 AM. Reason: Please use [PHP] tags when posting PHP code.
Reply With Quote
  #2 (permalink)  
Old 12-12-07, 12:58 AM
The_Demon The_Demon is offline
Newbie Coder
 
Join Date: Dec 2007
Location: The burning depths of hell
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Simplest solution is to probrably do

PHP Code:

$time date("g:ia",time() + 28800); 

Not tested, but should work
__________________
The Demon
Reply With Quote
  #3 (permalink)  
Old 12-12-07, 02:17 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Reply With Quote
  #4 (permalink)  
Old 12-12-07, 11:36 AM
Nikas Nikas is offline
Coding Addict
 
Join Date: Jun 2005
Location: Singapore
Posts: 377
Thanks: 0
Thanked 1 Time in 1 Post
Note that date_default_timezone_set() is only for > PHP 5.1
Reply With Quote
  #5 (permalink)  
Old 12-12-07, 11:54 AM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
Just about everybody on the planet should be using the latest version of php5.

The end of life for php4 is in about 19 days (the end of this year.)

Upgrade now or get left behind...
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Reply With Quote
  #6 (permalink)  
Old 12-13-07, 02:24 AM
HolyDevil's Avatar
HolyDevil HolyDevil is offline
Newbie Coder
 
Join Date: Aug 2007
Location: Terengganu, Malaysia
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
thank to all..it works now...:-)
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change url Deansatch JavaScript 1 12-08-07 03:33 AM
change text on click lylesback2 JavaScript 3 07-25-07 04:53 PM
how to change image in datagrid? daivagna ASP.NET 1 10-31-06 03:34 PM
change IE search URL or change window registry sma JavaScript 1 04-26-04 02:40 PM
change color of the arrow +scrollbar in a FORM (+checkboard/radiobutton/..) detorre CSS 0 01-31-04 06:30 AM


All times are GMT -5. The time now is 07:32 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.