My program works according to what day it is, and it works perfectly, however, I don't know if the date() function is relative to the date of where my website server is located, or is it relative to where the user is?

Here is an exact function i'm referring to:

$current_day = date("j");

It's only running on my localhost so I have no idea how it will work when I put it live, and someone in China uses it. I want to ensure it will display the correct day for everyone.

Thanks for the help!

Recommended Answers

All 2 Replies

Php is server side lanaguage so it will always shows date time of server where the script is installed.
You date time zone depends on UTC setting on your webserver.

If you use javascript date, it will show date time of the local computer where your page is opened.

Thank you! I think I'll use javascript...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.