Mervli Türkmen Mervli Türkmen - 1 year ago 85
PHP Question

standart time for my website

I want to supply my site with standard time for prevent confusion. I simple use this code

time ();
for getting time. But this function uses system's time. How can I make standard time for all users which is independent from computer's time.

Answer Source

You need to set the default time/zone which is then used by all date/time functions in your script


$current_date = date('d/m/Y == H:i:s');

It would be advisable that you set this in your php.ini file but the fact your asking something so basic I guess you're on a shared host and don't have access to the ini file so the code above is fine.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download