문제

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