zgkhoo Posted November 15, 2007 Share Posted November 15, 2007 echo "date=".date('Y-m-d h:i:s'); date=2007-11-15 15:48:14 the clock is the accurate at here..showing only 3pm ..while now my pc showing 11.51pm(localtime) Quote Link to comment Share on other sites More sharing options...
revraz Posted November 15, 2007 Share Posted November 15, 2007 Where is the Server located that the script is running on? Looks like it's 4 hours ahead of you. You'll have to adjust for time zone differences. Quote Link to comment Share on other sites More sharing options...
zgkhoo Posted November 15, 2007 Author Share Posted November 15, 2007 localhost xampp Quote Link to comment Share on other sites More sharing options...
elis Posted November 15, 2007 Share Posted November 15, 2007 No, where the server is physically located as a different time zone than you. Try this: $hourplus = "4"; $adjusteddate = date("l, d F Y h:i a",time() + ($hourplus * 3600)); print ("$adjusteddate"); Quote Link to comment Share on other sites More sharing options...
zgkhoo Posted November 16, 2007 Author Share Posted November 16, 2007 nope...i no upload to any server.. just try at my local apache server at my pc how? Quote Link to comment Share on other sites More sharing options...
zgkhoo Posted November 16, 2007 Author Share Posted November 16, 2007 the apache running at my pc... so the date/time should base on my pc's date time rite? Quote Link to comment Share on other sites More sharing options...
zgkhoo Posted November 16, 2007 Author Share Posted November 16, 2007 *bump* Quote Link to comment Share on other sites More sharing options...
revraz Posted November 16, 2007 Share Posted November 16, 2007 How many hours are you from GMT? Maybe there is a Offset setting in the PHP.INI file that you didn't set. Quote Link to comment Share on other sites More sharing options...
zgkhoo Posted November 23, 2007 Author Share Posted November 23, 2007 How many hours are you from GMT? Maybe there is a Offset setting in the PHP.INI file that you didn't set. offset setting? wats that? how to set? thanks Quote Link to comment Share on other sites More sharing options...
helraizer Posted November 23, 2007 Share Posted November 23, 2007 time(); would return the UNIX time stamp... but on Apache, which is a Windows server (I think) I don't think it'd work... Is your computer clock wrong? Quote Link to comment Share on other sites More sharing options...
pkSML Posted November 23, 2007 Share Posted November 23, 2007 Your PHP.ini file: [Date] ; Defines the default timezone used by the date functions date.timezone = In this directive, you need to list a timezone identifier, of which the list can be found here: http://us.php.net/manual/en/timezones.php Also go into Windows and check your timezone. Double click the time at the bottom right of your screen in the system tray, click the timezone tab and set it properly. Quote Link to comment 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.