<?php
/*
* Create PHP DateTime object from Date Piker Value
* this example expects the value to be saved in the format: yymmdd (JS) = Ymd (PHP)
*/
$format_in = 'Ymd'; // the format your value is saved in (set in the field options)
$format_out="d-m-Y"; // the format you want to end up with
$date = DateTime::createFromFormat($format_in, get_field('date_picker'));
echo $date->format( $format_out );
Related Posts:
- Is it possible to override the result of get_template_part()?
- Child Theme: how to override variables?
- roots child theme can’t override header.php
- Load template inside a parent template
- Child theme TEMPLATEPATH issue
- How does wordpress blocks?
- Display HTML only if Custom Field has a Value
- Updating modified templates
- ACF image field to WordPress featured image
- Child theme template file will not load
- Checking for page templates in child theme
- Should template files be copied to the child theme for editing?
- Advanced Custom Fields – display when specific template used?
- How to Increment ID value within ACF Repeater Field Loop
- Why does the Full-width Template in Twenty Twelve pack so many classes into the body class attribute?
- How to preserve changes in templates and other files
- Override Dokan Includes File in Child Theme
- lost css when overriding themes templates
- What template is used for viewing Media Library Files?
- Dynamically Insert Image Into Stylesheet
- Page header on specific page is different from the rest [closed]
- Parent/Child themes – both CSS files loaded
- Child theme enqueueing style.min.css not style.css
- How can I make custom page templates work on child theme?
- Why would adding a template file to a child theme cause an error in template-loader.php?
- WordPress Child Theme Template auth_redirect wrapper
- How can I add some blocks to template without changing template file?
- custom template – override plugin template in child theme – issue with scripts
- Unload templates; disable parent Template Parts using only “theme.json”
- Opinions and recommendations on the best barebones base theme [closed]
- Adding Page Attributes Metabox and Page Templates to the Posts Edit Page?
- Is there a way to list all used/unused WP templates?
- Print WordPress template filename(s) for debugging
- Change the name of the ‘Default Template’
- How can I modify the default reset (lost) password email text?
- Template files missing after moving site
- Grid layout “last” class to every third item
- How can I get the content of the home page?
- Why aren’t my posts showing?
- How to display error on specific template?
- How to move style from template file to section?
- What is content.php file that is needed for Jetpack infinite scroll plugin?
- Auto-Generate Longtail-SEO Pages/URLs
- Calling an image within the theme folder from inside a post/page?
- Best Constant to use to check if WordPress is running
- WordPress automatically created files like .theme-name / .plugin-name.php [closed]
- style sheet header on Page Templates
- Creating new templates in child themes breaks layout
- How to support custom templates on a custom post type?
- How to use $wpdb (from the template) to update the DB, without being an admin
- Page attributes missing
- Bizarre issue with custom RSS template
- Using shortcode in template file
- Display current category and child
- Return get_header and get_footer string instead of echo it
- Different templates for same content, landing page from different URLs (generic, simple)
- Use one template only for custom post type archives?
- Is there a more efficient way to loop through pages?
- Is it possible to register a new template file?
- != and !== both not always working? [closed]
- Page template for a site from network
- WordPress 3.3.1 single post template
- Conditional to determine if search.php page is the current template
- Prevent 404 and serve custom template for custom URL
- Page Templates not using functions.php
- use a custom page to display search results
- When a user registers, create a page from an existing template with their username as the page name
- Theme settings Page: Settings Api vs Update_Options
- How to add description over forum list on bbpress root page
- two active templates for one post
- Where is the code for “Front Page Template”?
- Help Understanding Template Hierarchy
- what is template-name.php
- templates with page teasers Or Featured Items
- If Child or Grandchild of Page
- Is it possible to create custom links inside a template?
- Advanced Custom Field Textarea not Showing (ListingPro Theme)
- Uncaught Error: Call to undefined function twentytwenty_the_post_meta()
- Timber + MtHaml, or any other HAML-like HTML shorthand
- How to configure my blog page
- BuddyPress : how can I call the template WordPress would have chosen (template hierarchy)?
- Archive only for /year/month, not terms
- Why default template does not show?
- Custom Taxonomy Theme file not routing correctly
- Child theme in separate WordPress Install
- WordPress not picking up custom templates in sub directory
- Is it possible to call a template file inside wysiwyg editor? And how?
- Retrieving post ID from current page
- Mysterious template change after database import/export
- Is there a way to share a template/markup with the JSON API so that it doesn’t need to be declared both in PHP and in JS?
- Styling own template
- WordPress sites translate dynamically generated Homepages
- changes to templates not showing on server
- Why is this page using the homepage template and not the one it should?
- Problem with permalink structure for WordPress custom post_type archive template
- Make default template two columns?
- Read more button not working
- pass dynamic value to page to pull in categorised post cards
- templates page not showing on gutenberg editor
- How to load php templates from html page (block theme)