سؤال

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?

هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى wordpress.stackexchange
scroll top