You can use createFromFormat to re-format your date. Like so:
$date = DateTime::createFromFormat('Y-m-d', '2021-12-06');
echo $date->format('Y F d');
If you want your output to be anything other than “2021 December 06”, please check PHP datetime formats for all available formatting options.
Related Posts:
- Calculate business days
- the_date() not working
- Archive listing of posts by publish year (multiple years)
- WordPress returns a wrong date
- Unable to set right time in admin and frontend template
- WP_Query meta_query results date by date
- Way to display “Yesterday”, “Today”
- display month in french in wordpress/php?
- Get date numerical and separate?
- Print last modified date only on posts
- Adding number to date not working [closed]
- Set meta field to publish date + 2 weeks
- How to manually change current date to post date in frontend?
- Convert WordPress date format to jQuery UI Datepicker format
- How would I use this filter to change the output of the date format to “Twitter time”?
- How to get User Time Zone in WordPress?
- Using php inside javascript [closed]
- Get date function not working
- Is there way to toggle the publish date display?
- If Post Published Date or Modified Date is 1 Year or Older, Display Notice on Post Page
- Issue in displaying the ongoing event and current events in the post
- WordPress wrong dates bug
- Don’t update modified post date when user add a product review or comment?
- Possible to edit custom date field and display?
- Get posts from year from URL
- Changing Date Format on Custom Meta Data w/shortcode call
- Primary navigation menu with timed items from custom post type
- Can’t add to time? [closed]
- Grouping posts by date
- WordPress change post date format from english to japanese
- Comparing Dates within plugin using PHP If statement
- Adding a number to a date
- Display Year and Month from custom field + Age Calculator
- Convert custom field date format to “WordPress default”
- Where to get information about array fields in $_REQUEST?
- Namespacing WordPress project according to FIG standards
- Redirect to Page after Post Submit
- automated tests as a user?
- WordPress Wysiwyg Content not being displayed
- Problems with function on function.php
- Want to create Child theme, but already edited Parent theme css files and some php files
- Adding code to child theme functions.php to override parent theme behaviour doesn’t work
- How to retrieve the content (with a specific ID) via ajax by clicking a link tag
- WordPress: Remove link in the_tags
- Set WP_MAX_MEMORY_LIMIT higher than PHP.ini memory_limit
- Custom category code not showing all posts
- Displaying NextGen Gallery using value from meta not working
- Apache Fallback instead of add_rewrite_rule
- Correct folder permissions?
- Link posts to pages for breadcrumbs
- Pass Category Name, Description and Photo into variables to pass to jQuery
- wp_nav_menu returns menu list in ascending order. How can I arrange the menu same as dashboard menu
- How can I add extra word in permalink when someone click download button?
- Why WordPress won’t update via VPN?
- Create custom permalinks to show Custom Post Type’s relationship?
- Add user ID to woocommerce customer dashboard
- Correct way to enqueue page specific CSS file
- Wrapping a Sidebar within
- update_post_meta only updating on last loop of foreach
- Link blogname and blogdescription to the Options Framework
- Why does the post_type_link hook everything twice?
- Adding conditional text to a PHP Shortcode Template
- wp_nav_menu not working correctly in my underscores theme
- use loop to return blog details
- PHP error when using newer PHP versions
- Fetching Initials of the Commentator in the WordPress Website
- fetch woocommerce product with custom taxonomy
- WP_Query with AJAX returning empty array
- How to add post meta in while loop?
- How can I Use 2 databases with one WordPress install
- How to set a featured image (thumbnail) with PHP?
- Output custom text field as unordered list
- Using Conditionals when homepage is a page and blog is /blog
- Can not call .php files after switching to %postname%
- WP Container Displaying Only on First Page of Archive
- Update Images after edit via php
- Drop down question
- custom mailchimp form using HTTP API
- ACF under category name in shop page [closed]
- WordPress Recent Posts – Loop
- Changing default WPMU emails to be send thorugh Campaign Monitor Transactional emails
- not able to access $_POST on backend profile update
- WordPress Single Post Pagination Numbered and Navigational
- Displaying 3 Category Posts differently
- I changed the password for the database user of my website, updated wp-config.php and wordpress asks to be reinstalled
- Post formating on Home page
- Category – “No content found”
- How can I correctly POST to a WordPress page?
- WordPress – Image href for home menu nav not working
- Search box background on a different page template
- Load php function with AJAX on modal window
- Hide page title
- Edit Image/Image Details – Replace button missing
- get user role. parameter id return type string [closed]
- Query posts by custom taxonomy slug in WP REST API?
- oneOf JSON Schema validation not properly working for custom post meta value?
- WooCommerce Modal Fly cart on add to cart – With AJAX
- /page/2/ redirect to 404
- How can I trim /page/ URL with PHP in WordPress
- Adding date and time to the same request