When we setup the timezone in wordpress settings page. Does it changes the server time? If I call time(); does it returns unix time according to timezone setup in the settings page?

I have checked this page here How to get WordPress Time Zone setting?

So, if i need to show suppose the current time of a neighborhood site what modification i have to do with the output of time(); function? The php time(); returns the time in the server. So is that depends on where my host belongs?

Thanks in advance!


WordPress tries to set PHP environment to UTC timezone. Usually it is more reliable to use time zone-aware WP functions, such as current_time(), rather than vanilla PHP functionality.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.