Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

The tag has no usage guidance.

1
vote
0answers
13 views

Randomised Post Time

I've imported a Drupal site to Wordpress with an archive of 1000s of posts which had been backdated by adding a custom taxonomy 'Year' rather than by adjusting the post date. I've been able to remove ...
2
votes
1answer
86 views

filter date and time to differents time zone

Any way to filter/change the display time only on the front-end with hook? Unfortunately, I can't adjust the timezone in General>Settings because it sets imported posts using Zulu as scheduled ...
3
votes
2answers
46 views

How to get year, month and hour in Wordpress?

Here is the code which gives me only day and month. I want to show all: year, month, day, hour and minutes. How can I do this? print '<time class="entry-date updated" datetime="' . esc_attr( ...
1
vote
0answers
18 views

Make WordPress use timezone for email Date header

My WordPress installations send emails with the Date header specified in UTC: Date: Wed, 18 Jul 2018 15:18:50 +0000 I would prefer that the mail be sent with dates encoded in localtime, which is ...
0
votes
0answers
15 views

How to bulk change posting date?

I have a custom post type (photograph). Due to bulk approval there are many that have the same date. This of course messes up the sort and navigation (prev/next post) system. How would I change the ...
0
votes
1answer
65 views

How to check for WordPress timezone type?

If you choose a city as a timezone it will save to the "timezone_string" option but if you choose a Manual Offset (UTC+1 for instance) it is saved to the "gmt_offset" option if you need the ...
0
votes
1answer
29 views

Displaying time & date problem

How to display the last time the site was updated(the last time either a post or a page was created/ modified/deleted) in the header of my WordPress site?
0
votes
1answer
63 views

Wordpress returns a wrong date

I am trying to get the todays date , day and time . Today is : 10th july 2018,tuesday and time is 3.23am For time the below code works fine: $wpplcurrenttime = current_time( 'g:i a', $gmt = 0 ); ...
1
vote
1answer
29 views

How to add 2 hours to the wordpress time formed with current_time(“mysql”, false)?

How to add 2 hours to the wordpress time which has already been formed using current_time("mysql", false)?
2
votes
1answer
65 views

How to remove current year from wp_get_archives

Does anyone know how to exclude the current year from $args = array( 'limit' => '', 'format' => 'html', 'before' => '', 'after' => '', '...
0
votes
1answer
15 views

Change the year of the whole site

I want to change the year of the whole site, temporarily, from 2018 to 2019. So the year of the_time() has to be 2019. There are no plugins which can do this... How can this be done ?
0
votes
0answers
36 views

Convert WordPress calendar from Gregorian to Lunar

I'm developing a website that sells products based on Lunar calendar using Woocommerce and Woocommerce subscription. Problem 1: Subscribers are supposed to pay on the first day of every month of ...
1
vote
1answer
22 views

Wordpress outputs mm/dd but it should be opposite

As an example, after update 4.9.5, my wordpress site outputs this timestamp in timezone settings: 2018-04-05 (5th of april) My site is set to Danish, and in Denmark the timeformat is dd/mm. The ...
0
votes
1answer
19 views

How to amend time format of comments, using child-theme?

How to amend (override) the time format of the comments (of the posts and pages), not touching the wordpress initial installation? I use a child theme and if it is possible in any way to do it from ...
0
votes
1answer
19 views

Get the most recently modified post date of most recently modified post

I have Googled this, but there are always answers to get the modified date of a single post, which I know how to do. What I'd like to do is get and display the most recent modified date of the most ...
2
votes
1answer
30 views

Get last seen date/time in wordpress get_comments() [closed]

I could get comment_date with a loop. And it shows like 2018-03-19 12:30:06. Here, I just want to get Last seen format. (For instance, 3 min ago , 1 hour ago , 1 day ago , 2 week ago ) How can I ...
-2
votes
1answer
136 views

How do I convert a custom field to a php date format? [closed]

I have a custom field with an example value of 2018/02/28 16:21. How do I convert that to 28th February 2018 at 16:21
0
votes
1answer
25 views

How get exact time difference

I have following code to get time diffrence $t1 = "1515397514"; //a timestamp value $t2 = "1515402944"; //a timestamp value echo date("M d Y H:i:s",$t1)."<br />"; //Jan 08 2018 07:45:14 echo ...
0
votes
1answer
27 views

Compare date fails when date is in next year [closed]

I'm using a conditional statement to compare the current date with a date of a custom post type. I'm using ACF for the date field of the custom post. The statement works fine if the date of the event ...
0
votes
1answer
34 views

Query posts using less than

I have a working query using pre_get_posts that queries posts using the status post format that only shows those posts if it's in a date range using the UNIX time stamp. Only problem is that the post ...
0
votes
1answer
187 views

Woocomerce pulling wrong time from server -5 hrs difference

I wonder could anyone help me with the time zones. In my wordpress i have the time zone set for New York, When i make a booking on my wordpress the booking is added to woocommerce cart and the time is ...
0
votes
1answer
966 views

ACF datepicker meta_query Compare Dates in m/d/Y g:i a - Not in Ymd Format

I'm looking for a way to use meta_query to filter out posts with a meta-key value of a date-time in m/d/Y g:i a format. The post-meta is being set by ACF (Advanced Custom Fields). I want to ...
0
votes
1answer
191 views

Ordering / grouping posts by datepicker ACF

I'm currently ordering a bunch of events based on a datepicker from ACF. They are all grouped per month, so all events of October are all listed together, than November, December and on. I only have ...
3
votes
1answer
195 views

change the comment time output to: X time ago instead of actual date and time

<?php printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()) ?> Above is the default code that exists for comments.php in the WP Core. This will produce an Output like this: ...
0
votes
1answer
60 views

Displaying the Month and Year that a page was Created?

Question How can I display only the Month and Year that a page was created? Background I have a page that will get changes has a field that shows the month and year. It needs to be in Month and ...
0
votes
2answers
166 views

Display published time for today's posts only

I'm building a blog theme. I know that the_date() and date() functions display published date of posts. And I know how to get posts' published time with the_time() function. I want today's posts to ...
0
votes
0answers
25 views

Force WP_Query to work in a local timezone [duplicate]

I have a template that displays an actual event if we have a today one, or a next future one. The template uses this WP_Query, that compares events date with the actual date: $args = array( '...
1
vote
1answer
377 views

human_time_diff() returns “48 years ago” for all comments

Trying to make a custom comments box. When I go to display the time when the comment was post (ie, 2 days ago, 3 hours ago, etc.) I get the same for every comment on every post: "48 Years" $args = ...
1
vote
1answer
27 views

Automatically Updating Publish Date Bug

I recently added a function to reset the publish date when a user updates a page. The code is as follows, thanks to @s_ha_dum for it because it works great except for one annoying instance. function ...
0
votes
1answer
24 views

How to setup language of a date in a plugin

I am working on a Wordpress theme using a template to manage sports team, matches, players, etc. I settled my local wordpress time in French. In the blog part, no problem the post are displaying date ...
1
vote
1answer
26 views

If else statement based on date_diff value

I have a problem with dates. I need to add if-else logic to show different content. It's based on date_diff values. And here's go a problem: I need to show button if today's date - post_modified ...
1
vote
0answers
25 views

Trouble Formatting DateTime

I've retrieved some meta information from the database, I believe that it's a Unix time stamp, made up of 10 chars. ( eg: 1498867200 (1 Jul 2017) ) I first had some trouble as it apparently came back ...
0
votes
0answers
21 views

Wordpress Server Time not changing/displaying correctly

I've diagnosed this as more a problem with the server than with wordpress itself (most likely) Basically, the day of the week is always tuesday, and the time is always 12:00 when I try to display it ...
0
votes
1answer
132 views

How to display Date and Time in Tamil Language?

Am working in a Tamil blog site.There I want to display date in Tamil language.(ie) செவ்வாய்க்கிழமை, மே 23, 2017 .I need to display like this in wordpress site.But I dont want to change all.Only the ...
0
votes
0answers
32 views

Help with time sensitive php function

I am trying to display a "Delete Post" link for front end users' posts using the following code. I can't get it to work and I don't understand PHP well enough to fix it. Any suggestions would be ...
0
votes
1answer
166 views

display last login date in the frontend

I am using this codes to add the column in the users listing page to show the last login by users. This codes are in my function file of my template: function insert_last_login( $login ) { global $...
-2
votes
2answers
64 views

Date is showing in unreadable format. How to convert to readable date?

I am using the following code to show the expiration date of my coupon; <?php _e('Expiration Date:','wpestate'); echo esc_html($expiration_date); ?> But, it is showing in following ...
0
votes
1answer
165 views

Sort a custom post with ACF: Date Picker & Display Featured!

Hello I have a custom post type event and i have two custom fields: event_date event_type I want to display all my events which has event_type = Featured and sorting should be by event_date in DESC ...
0
votes
1answer
73 views

Shortcode function doesnt work without caption

I'm working on a site that has this function to output the caption of a picture and is credits/date but doesn't work if only credits/date are definied and caption isnt. If thats the case the function ...
0
votes
1answer
83 views

Display datetime in user's timezone

How do I get datetimes like publication time to be displayed in a user's given timezone? I haven't been able to find a plugin that works.
1
vote
2answers
615 views

PHP function showing wrong time in WordPress

My local WordPress installation on XAMPP seems to have a wrong time setting. When I do date( 'Y-m-d H:i:s' ); I get 2017-02-21 10:46:43 as result. However my PCs time really is 2017-02-21 11:46:43, ...
0
votes
1answer
732 views

get_the_date() for translating date format

I want to display a in Hindi like "jan 10" using get_the_date(). What i have tried : <?php echo get_the_date(_e('F j')); ?> output like : F jJanuary 10, 2017.
0
votes
1answer
20 views

Array sorting assistance

I have the following array that I want to sort, how would I approach this as it only has one key / column? Short brief: I have movies that are saved in a custom post type. some have time allocated ...
1
vote
0answers
211 views

How do I join a $wpdb query with user meta using default value if not exist?

I am implementing a new feature to a website which gives users a certain amount of credits every week, if they are of a certain membership level. We are using Paid Memberships Pro and MyCred. Both ...
0
votes
1answer
36 views

Adding a number to a date

I confess... My php skills are bad. I'm trying to show an events duration within a post in an events category. Example: Oct 11-14 But I'm having a problem adding an integer to a date then printing ...
0
votes
1answer
281 views

Get current week's day and time outside the loop

I am trying to get the current week's day and time based on WordPress time settings. So for today, I want to output Friday and 2:56 PM for the time. The the_time('l') and the_date('d') functions ...
0
votes
2answers
280 views

Translate current_time

I have current_time in theme and it displays date like: THURSDAY, NOVEMBER 10, 2016. But I need to translate it to Persian. How can I do this?
1
vote
3answers
2k views

How can I display the current time? [closed]

Forgive me if this is discussed elsewhere on the forums but I can't seem to find it anywhere. How can we display the current time from the blog (or from New York, for instance) within a block of text? ...
0
votes
1answer
70 views

How to pass value to a plugins shortcode?

I'm using a plugin (Time.ly) which allows for shortcodes. The shortcode values set the display. I'd like to set one of the value's via current date and return the first of the month. Can I modify this ...
1
vote
1answer
274 views

Date format with genitive case of the month name is not working

Wordpress 4.4 indroduced a way to display the genitive case of a months name for specific locale by using the function date_i18n (https://core.trac.wordpress.org/ticket/11226#comment:32) which is ...