I know I’m three months late, but the function you want here is WordPress’ get_date_from_gmt()
.
The function accepts a GMT/UTC date in Y-m-d H:i:s
format as the first parameter, and your desired date format as the second parameter. It’ll convert your date to the local timezone as set on the Settings screen.
Example usage:
echo get_date_from_gmt( date( 'Y-m-d H:i:s', $my_unix_timestamp ), 'F j, Y H:i:s' );
Related Posts:
- How to get WordPress Time Zone setting?
- Running WP Cron on multisite the right way
- wp_delete_auto_drafts() deletes links in menus
- PHP function showing wrong time in WordPress
- How to run multiple Async HTTP requests in WordPress?
- Initialize WordPress environment to use in a real cron script
- How to get year, month and hour in WordPress?
- How to correct schedule my event weekly with wp_schedule_event()
- Multiple wp_schedule_event cron jobs in plugin cause multi-execution
- How to make sure that only one wp_cron() runs at a time?
- Why does this echo values in the wrong order?
- wp_delete_auto_drafts() deletes links in menus
- WordPress returns a wrong date
- How to check for WordPress timezone type?
- Unable to set right time in admin and frontend template
- Does wp-cron runs all tasks scheduled at same time together or one after other?
- How to start a script from cli within wordpress
- Convert a date to ISO8601 date format
- wrong php date()?
- display month in french in wordpress/php?
- Displaying the Month and Year that a page was Created?
- Get date numerical and separate?
- export a csv file from the database with a cronjob
- Cron events are disappearing, or cannot be updated in WordPress
- Print last modified date only on posts
- WP CRON duplicate wp_insert_post with has < and > tag
- How wp-cron can run in background if PHP is single threaded?
- WP Cron job timeout issues
- running wp-cron.php using php not wget
- Best way to schedule daily change in CSS parameter
- Find hours between post_date and post_date_gmt
- 3 different times on my WordPress website
- Scheduling an event inside plugin class is not working
- How to get User Time Zone in WordPress?
- Large WordPress CRON job
- Check If Post Was Published More Than 6 Months Ago Using get_the_date
- How do I check or test a WordPress Auto Year Change Script?
- How to Schedule Cronjobs for start of every month and year
- Shortcode function doesnt work without caption
- WordPress cron is running with previously set time intervals and not the updated one
- Comparing Dates from custom field
- Get date function not working
- PHP time function ($today) for GMT +1
- Can/should we delete wordpress cron jobs with no action?
- Hide publish date when update date
- If Post Published Date or Modified Date is 1 Year or Older, Display Notice on Post Page
- How to detect and handle the time difference between server and user in WordPress?
- Setting up a cron job to auto update a custom field
- No more get_option(‘date_time’) in WordPress 5.5?
- WordPress wrong dates bug
- Multiple cron jobs vs daily cron job doing multiple things? Which one yields better performance and scalability?
- post_exists stops working in a scheduled event
- CRON job to update wp_usermeta value each day or week based on server time
- Cron not sending wp-mail()
- Automatically delete posts one by one depending on published time
- How to pull date/time in french format for wordpress post?
- Php cron job (wp-cron) not working
- Use WP Cron to Clear a Page Cache?
- Can’t add to time? [closed]
- Update all posts in custom post types with wp_cron()?
- Ordering / grouping posts by datepicker ACF
- Sort WooCommerce data with WP-CRON?
- Array sorting assistance
- Adding a number to a date
- How do I routinely extract the thumbnail of the most recent post?
- Display Year and Month from custom field + Age Calculator
- Break a WordPress function to run in patches and re-continue
- WPMU schedule doesn’t execute actions
- Can i show items based on the day with php?
- How to execute add_action() function from custom plugin to Crontrol plugin or do_action()?
- How to avoid timeout waiting for output from CGI script?
- Display Current Time using shortcode
- How do I convert a custom field to a php date format? [closed]
- understanding wp_next_scheduled
- Change date/time format in custom plugin
- Error resetting database index using ALTER TABLE in $wpdb->query
- Convert custom field date format to “WordPress default”
- Background Tasks in a WP Cronjob?
- How can i remove all html tags from get_the_content()?
- Rename image uploads with width in filename
- Problems migrating WordPress to localhost
- Best way of adding CSS which can be manipulated by the user via theme option panels?
- How to show 50×50 image thumbnail in Related Post
- Recent Posts slider, using WP_Query(), loads duplicate sliders
- Getting error when trying to implement site-wide breadcrumbs in Twentytwentyone Theme [closed]
- How to save checkbox values for logged in users?
- Is it possible to return content, and then also continue to do other things?
- How to sent a email outside WordPress?
- Redirect to a page for only logged in user
- Add 23 hours 59 minutes and 59 seconds to meta key before saving?
- Storing content into a custom taxonomy
- WordPress pagination not working in search result page
- How to call custom function outside from the admin page?
- Post form – AJAX won’t upload featured image – Plugin development
- Redux option doensn’t seem when include from functions.php
- Set all WooCommerce Products to Simple, Virtual & Downloadable
- Inserting other fields to existing registration form in a WordPress theme
- PHP drop down menu for my get_category child of
- How to execute a shortcode within a custom field?
- using custom pages for myaccount in woocommerce