Question

I am trying to get the current week's day and time based on WordPress time settings. So for today, I want to output Friday and 2:56 PM for the time.

The the_time('l') and the_date('d') functions seems to be only working when in the loop, I could use date('l') but what if the php time is different than the time user sets in WordPress settings, could that happen?

Was it helpful?

Solution

Use current_time to output the time based on the timezone set on the blog's General Settings page.

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top