jemz — 2013-07-22T18:58:19-04:00 — #1
Hi, i tried this function
$date = date('m/d/Y h:i:s a');
but it is difference in the date of my PC...how can i get the system date of my PC.
THank you in advance.
fretburner — 2013-07-22T19:31:57-04:00 — #2
Is your PHP code running on your PC, or from a server?
jemz — 2013-07-22T19:34:58-04:00 — #3
Hi fretburner thank you for the reply,...running from my PC
ralphm — 2013-07-22T19:38:16-04:00 — #4
PHP only gives the time of your server. You need JS to get the time of the user's computer. E.g.
fretburner — 2013-07-22T19:42:07-04:00 — #5
If you want to make sure that your local server (on your PC) is displaying the right time, check that you have the correct timezone set for PHP.
You can change the global default for your system in your php.ini file (look for ), or you can set in on a per-script basis with the date_default_timezone_set function:
You can check PHP's list of supported timezones to find the correct setting for your location.
jemz — 2013-07-22T19:44:41-04:00 — #6
Hi ralph, thank you for the reply,Okay so i cannot get the time of pc if i use the date function...Okay i will try this thank you for this
jemz — 2013-07-22T19:45:46-04:00 — #7
Hi fretburner, Okay i will try this thank you again.
jemz — 2013-07-22T19:50:08-04:00 — #8
Hi fretburner, Thank you so much for helping me..it's working it coincide now to my PC...:) :nanaman:
sktthemes — 2013-07-23T05:13:45-04:00 — #9
Try this code
echo date('m/d/y h:i a', time());