Using wp_date() to determine date
-
Hi,
Can I use
wp_date()
in a script to determine a certain day in the site’s timezone, or should I not use the function this way?For example, I use this to determine which day it is:
$today = current_datetime()->getTimestamp(); $day = wp_date('w', $today); if ($day == '0') { echo 'It's sunday'; }
Guess it’s improper use, but just curious how you think about this..
Guido
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Using wp_date() to determine date’ is closed to new replies.