0

Im a little confuse with this particular function 'date()' Its a serverside time or it takes the time of the client computer?
See its shows a time that in anymeans is my current time but still when i change my pc time it also change

3
Contributors
6
Replies
79
Views
3 Years
Discussion Span
Last Post by PsychicTide
1

Perhaps this helps point you in the right direction (specifically the topic labeled 'Runtime Configuration' defined in the php.ini file)?
http://www.w3schools.com/php/php_ref_date.asp

EDIT: Found this as well... http://us2.php.net/manual/en/function.date-default-timezone-get.php seems there are several possibilities under the 'Description ' section... "If none of the above succeed, date_default_timezone_get() will return a default timezone of UTC."

Edited by PsychicTide

0

Perhaps this helps point you in the right direction (specifically the topic labeled 'Runtime Configuration' defined in the php.ini file)?

Many thanks this fixed the time, now is displaying same time as my pc, but why it change when i modify my pc time? if is a deffault timezone, its not supose to change according of my pc's time right?
Thanks

0

The us2.php.net link I provided mentions something about the "TZ environment variable". It's possible this can be "...specified by the operating system using system wide or user specific shell profile file" (linux). I'm not sure if the same idea applies to windows/IBM, but would imagine so.

Edited by PsychicTide

0

We can set it manually in your global file, like this

ini_set('date.timezone', 'Asia/Jakarta');
0

We can set it manually in your global file, like this

Already set it in php.ini like PsychicTide said. but it changes based in my pc's time. How can i set it in someway that dont rely on pc's time?
Example danny web says the post was make 19 hours ago, and when i change my date is still 19 hours ago

Thanks for the help

0

I have no idea, but perhaps the time the post was submitted to daniweb would be a timestamp saved in a database somewhere, could then judge time since by daniweb's currently set time (comparison of current and saved server timestamp)?

just a random guess.

Edited by PsychicTide

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.