date()
is a PHP
function depending on your server settings. You can go around that by using the WordPress function:
current_time( 'Y-m-d H:i:s' );
This function takes the settings in wp-admin
into account.
Related Posts:
- How to get WordPress Time Zone setting?
- How to check for WordPress timezone type?
- How to get User Time Zone in WordPress?
- How to detect and handle the time difference between server and user in WordPress?
- Converting timestamps to local time with date_l18n()
- How to get year, month and hour in WordPress?
- Why does this echo values in the wrong order?
- WordPress returns a wrong date
- Unable to set right time in admin and frontend template
- Convert a date to ISO8601 date format
- I get “The PHP Date/Time library is not supported by your web host.” on my CentOS host, what library to I need to install to add support?
- wrong php date()?
- display month in french in wordpress/php?
- Is XAMPP faster than running LAMP in WSL on Windows 10? [closed]
- Displaying the Month and Year that a page was Created?
- Get date numerical and separate?
- XAMPP-VM Mac OS Mojave wordpress debugging using XDebug
- Print last modified date only on posts
- Find hours between post_date and post_date_gmt
- 3 different times on my WordPress website
- Is there any way to get a drop down list of time zones?
- 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?
- Fatal error: Uncaught Error: Call to undefined function get_header() [closed]
- Shortcode function doesnt work without caption
- I installed WordPress locally now how do I login?
- Comparing Dates from custom field
- How to prevent a function from running based on host (ie web vs local)?
- Get date function not working
- PHP time function ($today) for GMT +1
- WordPress time queries
- Trying to copy linux blog locally with XAMPP – php fatal error
- Hide publish date when update date
- If Post Published Date or Modified Date is 1 Year or Older, Display Notice on Post Page
- call to undefined function mysql_connect
- current_time function incorrect in plugin and PHP, not in WordPress admin
- No more get_option(‘date_time’) in WordPress 5.5?
- WordPress wrong dates bug
- How to pull date/time in french format for wordpress post?
- Can’t add to time? [closed]
- Ordering / grouping posts by datepicker ACF
- Array sorting assistance
- Adding a number to a date
- Display Year and Month from custom field + Age Calculator
- Can i show items based on the day with php?
- Display Current Time using shortcode
- How do I convert a custom field to a php date format? [closed]
- Change date/time format in custom plugin
- Convert custom field date format to “WordPress default”
- How to use nonce with front end submission form?
- is there a simple way to list every templates / php files used to generate a specific page?
- Correct way to make static pages editable in wordpress
- WordPress php error after editing file with FileZilla
- Class ‘WP_Widget’ not found
- Second Navigation inside header
- Listing and displaying WooCommerce Shipping Zones in the frontend? [closed]
- how to trace notice warning on core function is_page() & is_singular in class-wp-query.php
- A function that returns true when the Author is a certain role is_author(admin)?
- Add a class to the anchor tag on HTML5 gallery
- get_term_link() returns incorrect url
- Display a specific category of products in shop page and disable code for specific actions
- Cannot access wp-admin (wordpress dashboard)
- Saving and Restoring a Canvas on A Individual User Basis
- Get children post mime type using parent post_ID wp_post
- Is it better to store images and other files in the root directory or the theme directory
- Use .php file as page instead of wordpress page & template file?
- How to get post permalink url without a href
- Convert the_permalink() function output into string
- get_current_site() is undefined
- Incrementing PHP variable onclick to display posts by month
- Use variable in SQL statement
- writing an unique php function to be used on my website
- Get options from database using php class
- Problem in replacing the_content with the_excerpt()
- Need to add a post’s featured image to a section on the frontpage
- Output product category link from WP_Query
- Adding onload to body for certain pages
- Additional file upload in Gutenberg page options/featured image
- Variation prices breakdown only for single product page
- Change wordpress’ database data using ajax – how to get current user id?
- Add css class to string
- How to block specific user id in custom login form?
- Passing a value from an input field to a php function in WordPress?
- Display all categories including sub categories under a list ul
- Store user form submitted information in post type
- Block that renders html saved in a php file
- WordPress files break if I edit them, but adding a closing PHP tag fixes it
- $_GET[‘title’] in WordPress
- Can’t update or install plugins in WordPress, php unidentified index
- Offset with ajax load more posts duplicates
- WP Redirect with user nickname/username
- If else statement based on referral URL
- Hide sharing box and author box with a metabox on WordPress
- WordPress Website Featured Image Replacement Issue
- syntax error unexpected ‘}’ at 364 line
- 500 error when using wp_upload_dir() [closed]
- Using Excel formula in PHP. Use ^ symbol [closed]
- WordPress online courses system
- How to align buttons properly [closed]
- Displaying generated HTML within a WordPress site