get_post_time(‘U’) and get_the_date(‘U’) wrong Timestamp
-
Hi,
my wordpress is set to the correct timezone (Europe/Berlin), my server is aswell (I checked it with the command date in SSH) and date_default_timezone_get() gives back the correct timezone as well. My posts are saved with the correct date/time in the wp_posts table. But since I updated from WordPress 4.x (don’t know which version exactly) to WordPress 5.3.2 the functions get_post_time(‘U’) and get_the_date(‘U’) to get the post timestamps aren’t working for me anymore. They give back the timestamp of one hour ahead from local time. This means if I publish a post get_post_time and get_the_date(‘U’) return the timestamp for one hour ahead. If I use get_the_date(‘U e’) it gives back the correct timestamp though.
Do you have an idea why this happens? At the moment I have to use get_post_time()-3600 or a substr of get_the_date(‘U e’) to get the correct timestamp.Thanks for your help!
- The topic ‘get_post_time(‘U’) and get_the_date(‘U’) wrong Timestamp’ is closed to new replies.