You can use PHP’s date()
function here, but usually first you’ll need to run date_default_timezone_set
. UTC+1 looks like Central Europe time from what I can tell, so here’s what I’d run:
<?php
date_default_timezone_set('Europe/Berlin');
echo date( 'D, d M Y H:i:s', now() );
?>
That will print out the current time from your server.
If you’re looking to print out a timestamp from a post, you can use get_post_time and print replace the now()
function. Looks like this:
<?php
date_default_timezone_set('Europe/Berlin');
echo date( 'D, d M Y H:i:s', get_post_time('U', true) );
?>
Related Posts:
- Converting Unix timestamp to wordpress date
- Count time from registration date to today
- Update existing post times to random times?
- Timezone for Plugin
- How to get Unix Local Time?
- How to second orderby in “pre_get_posts” by meta value or combine single date and time to timestamp
- Unable to select an old date in wordpress
- How to get date for each post?
- Date, Time, and Timezones
- Modify Date Format to German
- Serve visitor post time adjusted to their timezone
- Styling the date format with date_i18n
- Date and time format for UK in a custom post type [closed]
- What are the “U” and “G” time formats?
- date() returns incorrect value if used from WordPress theme, but correct otherwise
- How to get date using timezone saved in options? [duplicate]
- wordpress convert timestamp to date not correctly
- display month in french in wordpress/php?
- Set the publication date independent of the scheduled publication date
- About Time conditionals
- Format Date for Manual Insertion into post
- Translate current_time
- Display published time for today’s posts only
- convert time to WordPress user’s local time
- How to get User Time Zone in WordPress?
- Show different time stamp based on time
- Can’t convert ACF datepicker value to DateTime oject – gives me a boolean
- Can’t add to time? [closed]
- How to display Date and Time in Tamil Language?
- Get current week’s day and time outside the loop
- Use the_date with link
- automatic send email at custom time
- Change the date and time in wordpress
- Make datestamp for status updates show time
- Advanced Custom Fields and date picker, show posts only if the day is today no matter the year
- How to customize Date Format for American visitors?
- How to get current timestamp in string format in Java? “yyyy.MM.dd.HH.mm.ss”
- Java SimpleDateFormat for YYYY-MM-DDThh:mm:ssTZD
- The purpose of the post_date_gmt?
- How to integrate get_post_time with date_i18n function?
- How to show the real post date in a draft
- Why time functions show invalid time zone when using ‘c’ time format?
- How to remove published date from RSS feed
- datetime picker, timestamps and meta queries
- WordPress returns a wrong date
- WordPress post dating – pre 1901?
- the_modified_date returns published date
- filter date and time to differents time zone
- Page Revision date displaying on google search
- Relative time – how to calculate difference beween post publish date and current time
- Calculate future date
- Advanced custom fields: Customise date picker’s start date (need to choose year 1500 onwards) [closed]
- Show post updated date instead of published
- If modified on same day, show only time
- Mini app that shows one unique quote each day. 56 rotating posts rotating for each themed weekday. It works, but I need your advice
- Update all comments time to random dates?
- Make WordPress use timezone for email Date header
- Trouble Formatting DateTime
- Placed on + only date (not time)
- Escaping date string in url with wordpress
- How can i display time minus 6 hours
- Is there anything special I have to think of when setting post_date_gmt when inserting a new post?
- Get_the_date doesnt show todays date [closed]
- Time & Date on Post – Time Ago Custom Function
- Are there any know limitations on the date field, especially how old dates can be?
- How get exact time difference
- Changing default WP-Site creation date
- Where does the time get pulled from in the_time()
- Bulk Updating Post Date in 1 day Increments
- Display Author Registration Date
- How display modified date of most recent modified post in wordpress?
- Date Language doesn’t change
- display future posts in date page
- Month display in English but required in Swedish?
- Date is wrong on ‘all posts’ page
- Update post date of page when Visitor access that page?
- Get date function not working
- If Post Published Date or Modified Date is 1 Year or Older, Display Notice on Post Page
- Is it possible to change X Hours Ago to date in WP Admin?
- Display Current Date using shortcode
- Check if is Post or Comment
- Get current user last post date
- WordPress wrong dates bug
- Change pubDate in rss feed in another format
- How to add published date in product [closed]
- How to hide post published date?
- datetime picker, timestamps and meta queries
- Notify after 3,6,9 and then 12 months after plugin activation
- suffix title with “EXPIRED” when scheduled post has reached it’s published date
- Display ‘modified date’ in WordPress Twenty Fourteen
- Time sort with meta_key using UNIX timestamp failing due to date differences
- Comment time is same as the post time
- Use esc_attr() to print month name in French
- Show monthly or daily archives
- wp_date doesn’t work
- How to get the date of all blog posts
- Datetime on time tag wordpress puts it outside the tag
- In my Website homepage I want to remove date which is written along author name [closed]
- get_the_date() return always UTC+0 [duplicate]
- Docker Container time & timezone (will not reflect changes)