Did you go to Settings >> General
and set the correct offset for your timezone?
To get the date:
<?php $date = get_the_time('dmY', $post->ID); ?>
To print the date:
<?php the_date('dmY'); ?>
Both need to be within the Loop!
Related Posts:
- Get list of years when posts have been published
- Date/time limitation of posts where function must be executed
- Individually styling date month year [closed]
- Ordering posts by publish date not working?
- How do display most popular post from a year earlier to the day?
- Updating Media Published Date When Parent Post Is Modified in WordPress
- Remove the month and year from a WordPress Date?
- How do I display a date correctly that is stored in the database as a backwards 8 digit number from Advanced Custom Fields? [closed]
- Getting images from media library and get_the_date() not working
- Changing date query from month
- wordpress built-in Jalali date convertor
- ACF Date Form in Custom Admin Field
- Change Post status based on custom field date +1 day
- get php variable from functions php and echo it in theme template files [closed]
- Use AJAX in shortcode
- How to influence the information displayed on widget inside wp-admin
- Remove Container Element From wp_nav_menu() Markup
- WordPress function like is_category for subcategory? is_subcategory?
- WordPress Theme Update Action?
- Using a private method as an action callback from within a class
- Auto close (hide) custom metabox / set default state
- Does WordPress Development Mode Exist (with not minified JS)?
- WP_Query in functions.php
- wp_delete_user with username
- what is the meaning of settings_fields()
- Organize functions.php
- How to activate “Description” metabox for menu item programmatically?
- Change labels on ‘Nickname’ and ‘Biographical Info’ in user-edit.php
- Edit the_content function
- write in functions.php
- How to set child post categories to parent post categories when updating parent post?
- get excerpt without images
- display 100 products per page on product category page [closed]
- Adding WooCommerce to a Custom Theme – not working [closed]
- WooCommerce add_action hook results in 500 error
- Advice: Template structure – php blocks in sidebar or someting else?
- Help to resolve Syntax error, unexpected ‘endwhile’ (T_ENDWHILE) [closed]
- wp_get_post_terms() returns WP_Error in functions.php but in template it works
- Removing the first image in content
- Move jQuery and Migrate to footer?
- Make menu structure match page heirarchy on page parent change
- Global functions on WPMU
- is_account_page() change to page slug
- How to add nav menu items to a specific position within a menu
- woocommerce: change default setting > is_sold_individualy function
- Help with WP gallery function, wrap gallery in div
- set_post_thumbnail when user is not logged in
- call of javascript function to external url always blocked by cors
- Can you put a condition on add_image_size() depending on the width of the uploaded image?
- Force to use STRONG users password and implement rule to prevent REUSE [closed]
- Create a custom taxonomy that will be used to create and filter markers in a Google Map
- Adding an external HTML link to a post thumbnail
- Overwriting the menu break points of twentysixteen in child theme
- Is there a WP function to get taxonomy name from taxonomy_term_id?
- Passing User_Fields to Contact form 7 [duplicate]
- How can this crude function be improved?
- Help With Creating Shortcode
- How to set default post editor based on role?
- How to hide image-url if no attachment?
- Hide thumbnail on search results when thumbnail not set – using Oxygen
- How to properly refresh page after form action?
- Default Nav Highlight
- Using two loops in one WordPress template
- Multiple navigation menu in same location
- WordPress Website with Login system
- Return link pages instead of displaying them
- Adding Read More to Custom excerpts
- referencing the current user in a page i created in wordpress
- is_main_query() always returning false
- Counting posts and trigger it [closed]
- modifying every other element’s class inside while loop
- Adding Custom Body Class for Page: Shop
- Replace theme function
- How to access custom class methods from any include without using global
- Is it possible to use ‘wp_insert_post’ function within a for loop?
- save_post function keeps triggering: Warning: array_map(): Argument #2 should be an array… when restoring from trash
- More than one search results page template for two searches on site
- How do i create a search option for pdf’s only
- Redirect after login to current URL
- Restrict certain roles registrations by domain
- Replacing term/taxonomy archive pages with search queries
- Return ACF Field value function
- Best way to add image to recent posts widget?
- Function to draw random image from specified category destroys site logic – why?
- Issues with add_query_arg() not passing a variable
- Move captions under gallery images in twenty fourteen theme
- Force changing the Site Title and add link
- create submenu page – error function not found or invalid function name
- Get Value of Custom Field
- Undefined offset: 2
- Sorting date results from a query
- Using is_plugin_active within functions.php
- Button generate a random URL [closed]
- How to Delete Posts by title?
- How do I add functionality to images?
- Display function from functions.php in tag.php
- AJAX values converted to PHP Variables?
- Get all users from role and add to dropdown (select) – wordpress, javascript
- Add functionality to block comment authors in the Comment edit pag
- WordPress enque the same script causes the setInterval not to work