tauchai83 Posted January 26, 2007 Share Posted January 26, 2007 i wonder why the date i echo <?php echo date("d M Y"); ?> can give me the yesterday date...like it display 26 jan instead of 27 jan...i'm from asia...why this happen/ is it the date in php follow europe or us time?today is 27th for my place here... Quote Link to comment Share on other sites More sharing options...
tauchai83 Posted January 26, 2007 Author Share Posted January 26, 2007 the date will folo the date on my pc rite? Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 26, 2007 Share Posted January 26, 2007 No, it's server time. PHP is a server-side language. Quote Link to comment Share on other sites More sharing options...
tauchai83 Posted January 26, 2007 Author Share Posted January 26, 2007 but b4 this it did display today's date according to my pc ..i running localhost....how to solve this problem??? i use AppServ..did u mean it follow AppServ localhost server date??? Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 27, 2007 Share Posted January 27, 2007 I realize you're in Asia, but presumably you speak English, and can type it properly. The chatspeak is annoying enough to make me not want to help you.If you were running it on your computer, your computer was the 'server', so it used your time. If you're using a new server, it will use that time. To display the time of a user's computer, you should use a client-side language such as Javascript, or let the user set their timezone and calculate it that way. PHP has no way of telling what the client-computer's settings are. Quote Link to comment Share on other sites More sharing options...
tauchai83 Posted January 27, 2007 Author Share Posted January 27, 2007 oopsss..sorry....i don't know what i wrote here has irritated you...i'm sorry...ok...that's good explaination...thanks...i hope you wont be feel annoyed by my message next time..hehe:) Quote Link to comment Share on other sites More sharing options...
Caesar Posted January 27, 2007 Share Posted January 27, 2007 I feel your pain jesi. ;) 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.