| Author |
Message
|
| cutiencoco |
Posted: Sat Jun 27, 2009 5:25 pm Post subject: Incorrrect Local Time |
|
|
Joined: 25 Jun 2009 Posts: 8
|
I've used idate(),mktime(),time() for return local time, but it always return the wrong hour for me? Can anyone help me?
| Code: | <?php
echo(idate("h"));
?> | |
|
| Back to top |
|
 |
| Paul |
Posted: Sat Jun 27, 2009 10:29 pm Post subject: |
|
|
 Site Admin
Joined: 10 Dec 2007 Posts: 143 Location: New Zealand
|
|
| Back to top |
|
 |
| cutiencoco |
Posted: Sat Jun 27, 2009 11:35 pm Post subject: |
|
|
Joined: 25 Jun 2009 Posts: 8
|
yes ar
the php code shows a different time from my computer (the most right hand bottom corner clock of window vista) |
|
| Back to top |
|
 |
| Paul |
Posted: Sat Jun 27, 2009 11:40 pm Post subject: |
|
|
 Site Admin
Joined: 10 Dec 2007 Posts: 143 Location: New Zealand
|
Are you running PHP on your local PC or from another computer?
If you running web service from another computer/server, then you'll need to add/subtract time difference between your local time and server time.
This is because local time means local time of the web server, not your own pc. _________________ Paul KH Kim
http://www.onlinesolution.co.nz |
|
| Back to top |
|
 |
| cutiencoco |
Posted: Sat Jun 27, 2009 11:57 pm Post subject: |
|
|
Joined: 25 Jun 2009 Posts: 8
|
Thank you, Paul.
I use appserv(php and mySQL) to construct my website and run php on my local PC .Could you please tell me how can I do the local time setting in Appserv? |
|
| Back to top |
|
 |
| Paul |
Posted: Sun Jun 28, 2009 12:04 am Post subject: |
|
|
 Site Admin
Joined: 10 Dec 2007 Posts: 143 Location: New Zealand
|
Are you doing web hosting or server hosting? (ie, do you have SSH root account for your web server?)
If you're doing web hosting then you'll need ask Appserv for the server's local time details because hosting company will only able to change server's local time.
If you have ssh root account, then check your server's local time by using date command from SSH. _________________ Paul KH Kim
http://www.onlinesolution.co.nz |
|
| Back to top |
|
 |
| cutiencoco |
Posted: Sun Jun 28, 2009 12:10 am Post subject: |
|
|
Joined: 25 Jun 2009 Posts: 8
|
Really thank you for your reply
In fact, I don't know what can I do
I am just running localhost |
|
| Back to top |
|
 |
| Paul |
Posted: Sun Jun 28, 2009 12:13 am Post subject: |
|
|
 Site Admin
Joined: 10 Dec 2007 Posts: 143 Location: New Zealand
|
Sorry, I think I'm bit confused.
If you running from localhost (running webserver with PHP + MySQL from your own PC), double click righthand side clock and double check your time zone.
Timezone might affect your settings. _________________ Paul KH Kim
http://www.onlinesolution.co.nz |
|
| Back to top |
|
 |
| cutiencoco |
Posted: Sun Jun 28, 2009 12:38 am Post subject: |
|
|
Joined: 25 Jun 2009 Posts: 8
|
| do you mean the right hand corner clock of window vista? I've checked it is the right timezone but it still does not work. |
|
| Back to top |
|
 |
| Paul |
Posted: Sun Jun 28, 2009 12:41 am Post subject: |
|
|
 Site Admin
Joined: 10 Dec 2007 Posts: 143 Location: New Zealand
|
|
| Back to top |
|
 |
| cutiencoco |
Posted: Sun Jun 28, 2009 12:55 am Post subject: |
|
|
Joined: 25 Jun 2009 Posts: 8
|
yes, I tired it.
It still gave me the wrong local time.
Anyway, thank you for your help. |
|
| Back to top |
|
 |
| Paul |
Posted: Mon Jun 29, 2009 4:26 pm Post subject: |
|
|
 Site Admin
Joined: 10 Dec 2007 Posts: 143 Location: New Zealand
|
|
| Back to top |
|
 |
| cutiencoco |
Posted: Tue Jun 30, 2009 7:06 pm Post subject: |
|
|
Joined: 25 Jun 2009 Posts: 8
|
It works! Really thank you for helping me to solve the problem.  |
|
| Back to top |
|
 |
|
|