The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
2answers
24 views

How to use Internationalized human_time_diff() function in Chinese?

Looking at https://codex.wordpress.org/Function_Reference/human_time_diff I'm using an English version of Wordpress. In my theme template, I would like to define custom text of min, hour, day, week, ...
1
vote
1answer
31 views

Converting Unix timestamp to wordpress date

I have trouble converting Unix timestamp (i.e. 1473897600) to Wordpress friendly date which displays at the date input field. I have a frontpage, post edit panel which is showing Unix timestamp. I ...
0
votes
0answers
66 views

Query between dates using ACF date AND Time Picker fields

I'm looking to be able to query (custom) event posts by date AND time. displaying a range of events on any given days. I should also be able to query events that span across multiple days, whilst ...
0
votes
1answer
71 views

How can i display time minus 6 hours

how can i display date and time minus six hours in a post. For example now it's 23/02/2016 14:54, I need to display 23/02/2016 8:54. I'm using this in function.php of my theme: function displaydate(){...
0
votes
1answer
38 views

Update File Once Every 30 Days

I'm building a plugin that requires a database file which is updated monthly. I would like to write a function that automatically replaces the old file once every 30 days. Here's what I have so far. ...
0
votes
1answer
193 views

Change HTML Produced by wp_list_comments()

I am developing a WordPress theme for which I would like each comment's timestamp wrapped in in a <span> element for the sake of styling it with CSS rules. However, the wp_list_comments() ...
0
votes
1answer
65 views

Calculate how much time passed comparing WordPress comment and current time

I'm building a WordPress plugin. I need to show time like Twitter - how much time ago the comment was made etc. Is there a way doing this? Suppose someone comments 1 hour ago should be visible 1 hour ...
0
votes
0answers
46 views

Convert WP publish date to unix time and populate a custom field

I have a custom post type called "Stories" and I am using an RSS to feed to create a new custom post with each entry from the feed. The client needs to be able to add manual "Story" posts too, which ...
1
vote
1answer
47 views

How to make debug.log timestamps local time?

I look at the debug.log file a lot while developing, and having all the timestamps in UTC drives me crazy! How can I get them to display in local time? I have my php.ini 'date_timezone' value set to ...
-1
votes
1answer
86 views

Show monthly or daily archives

My code is this: #http://localhost/wordpress/2015/04/01 if (is_day()) { } //Prints January, April, 2015 #http://localhost/wordpress/2015/04/ if (is_month()) { echo single_month_title(' '); //...
0
votes
2answers
541 views

Remove Page Timestamp via functions.php so it doesn't show in Google Search Result Description [closed]

I want to remove the last updated / last modified date from pages (not posts) via functions.php (could this be done by making that hook __null?) The goal is to remove the google search result ...
1
vote
1answer
27 views

About Time conditionals

I'm trying to compare times like: if this post was posted between the past 6months show human_time_diff() else show the_time('j. M .Y') my idea was: function time_ago() { global $post; $...
1
vote
0answers
66 views

Placed on + only date (not time)

When I create a comment or, ... you can set Placed on. For example: 20 june, 2014 on 14:23 . But I don't want the time (14:23). Only 20 june, 2014. Is this possible, and if so, how can I do this? ...
0
votes
0answers
275 views

WP_Query with UNIX timestamp in meta query

now idea why this isn't working, please point me in the right direction! Here's my main query; $events = new WP_Query( array( 'posts_per_page' => -1, 'meta_query' => array( ...
0
votes
1answer
78 views

Getting timestamp of activation plugin time

I want to save the time that the user activates a plugin. So I need to set the value within the function that the registration hook fires: function ucme_reg_func () { //------------other functions----...
0
votes
2answers
457 views

Individually styling date month year [closed]

I am using underscore_s barebone theme to build mine and came across this challenge that I would like to style date month and year separately with CSS and the code output puts them together. I dug ...
1
vote
1answer
892 views

Relative time - how to calculate difference beween post publish date and current time

I want to calculate the difference between post's publishing time and current time, and I want to read that value as a number (number of hours, minutes, seconds whatever, i just want it to be a number)...
0
votes
0answers
91 views

How to display time when page is created and edited

On posts I use this: Time created <?php the_time('Y-m-d'); ?> Edited (updated) <?php the_modified_time('Y-m-d'); ?> It works fine on posts, but on page template it displays just ...
0
votes
1answer
325 views

Selecting posts older than the current Unix epoch timestamp

I am trying to perform the following query, which originates by the fact the post's 'date' and 'time' are entered as separate custom fields. $args = array( 'post_type' => 'some_kind_of_posts'...
1
vote
1answer
29 views

Swatch Internet Time for article timestamps

The date and time when the article was published is shown below the article title. How do I show Swatch Internet Time there instead of local time?
0
votes
1answer
94 views

Convert all dates in field to Unix time, except those already in Unix time

I have a meta field that is mixed with MM/dd/yy hh:mm dates and Unix timestamp dates. How do I convert all of the MM/dd/yy hh:mm dates in the db to Unix? I have only limited PHP and SQL knowledge so ...
1
vote
1answer
84 views

Calling Different Custom Post Timestamps in a table

I use WordPress to run an events site that people can sign down to if they have a subscription. At the bottom of each event, if you are admin you can see a guest list with Name, Email, Tel, Avatar (...
0
votes
2answers
275 views

How to second orderby in “pre_get_posts” by meta value or combine single date and time to timestamp

This is somewhat of a continued problem from another question that I had asked. Here is the original post. pre_get_post filter returns results when there should not be Since then I added an orderby ...
0
votes
1answer
669 views

Time sort with meta_key using UNIX timestamp failing due to date differences

I'm dealing with the following issue trying to sort a custom post type by a meta key created using the Advanced Custom Fields plugin Date and Time Picker add-on. The add-on creates a jQuery datepicker ...
0
votes
2answers
90 views

Custom time field won't sort regardless of format

I'm using a custom fields plugin for WordPress (Advanced Custom Fields) and am using a time picker field set to format: "h:mm tt". Using a typical WP query, I'm attempting to sort by "start time" in ...
0
votes
1answer
1k views

WP Cron job every 1st and 15th of the month

Trying to set up custom schedules for WP Cron, knowing that they use an interval is it even possible to set up a cron job for every first of the month? As well as every fifteenth. This is what I have ...
2
votes
2answers
547 views

Date, Time, and Timezones

I am a bit confused about using dates/times along with timezones in WordPress. I have the following questions: What is the purpose of the timezone setting in the Admin -> Settings section? Assume ...
0
votes
1answer
28 views

If I change the taxonomy of a post will it get a new time stamp?

I have a category called feature that displays the latest post, but further down the line if the user wants to make an older post a featured post, it doesn't currently work. Using the time stamp would ...
0
votes
2answers
2k views

current_time('timestamp') seems to be different from the real current time

Does current_time('timestamp') have an issue? I am trying to get the current_time('timestamp'), and instead of giving me my current time: Jun 26 2013 14:30 It gives me: Jun 26 2013 21:30 I ...
0
votes
1answer
116 views

How to change post date only 1 time a day?

I have this code is_admin() or add_action( 'the_post', function( $post ) { if ( ! is_singular() or ! is_main_query() ) return; $post->post_date = current_time( 'mysql' ); $post->...
0
votes
1answer
99 views

Auto update date time 1 times per day?

How to update automatically date time of page to current time only 1 time per day? Example: I write a post on May 28, 2013. And if today is June 9, it will change may 28 to June 9. And if today is ...
0
votes
1answer
32 views

Make datestamp for status updates show time

I have an installation of Wordpress 3.6 running on my server. Playing around with it, I found that 'status updates' don't show the time posted: Here's the thing: I want the time there too. ...
0
votes
2answers
539 views

Integrating Human Time Difference and Traditional Timestamps?

My goal is to use human_time_diff only when the post was added on the current day. When it wasn't, I would like to revert to the traditional timestamp (the second code). I'm unsure how this would be ...
-3
votes
2answers
405 views

Datetime on time tag wordpress puts it outside the tag

I want to use a time tag with the datetime attribute in it... I tried this in functions.php: <time class="time" datetime='. the_date('d-m-Y') . '>%3$s '.get_the_time( $d, $post ).'</time>'...
0
votes
1answer
73 views

Where does the time get pulled from in the_time()

I am currently using the following function in my footer <?php the_time( 'Y' ); ?> But the footer keeps showing 2011, instead of 2013. So where does this time stamp get called from exactly?
0
votes
0answers
286 views

Using strtotime() and update_post_meta not saving

I would like to take a date entered in a meta box field, & convert it into a Unix timestamp (dd/mm/yyyy) and save it in the wp_postmeta table. But my code isn't working: function ...
0
votes
1answer
366 views

admin end post published time display not working correctly

I have the inconsistency in post published time. For example, as I published a post on April 20nd 9pm and it is April 20nd 9:30, wordpress shows it is published one minute ago in the admin end. Also ...
1
vote
1answer
723 views

How to add a new meta key and assign timestamp to posts

I've been trying to look for a way to create a loop in my website and show posts being read/watched but have not found anything. The only way I can accomplish this would be to create a new meta key (...
1
vote
1answer
689 views

Register script/style: Is it possible to customize the version query string via plugin?

Expanding on the question in the title: I would like to find a way (via a plugin) to use timestamps for the JS and CSS file version query strings that are output with wp_register_style and ...
4
votes
1answer
558 views

When does next Cron Job run (time from now)?

I would need to know how much time is left between now and the next time a specifc Cron Job is done. For another answer I built a basic cron inspector plugin which can be found here. Reason I'm ...
0
votes
1answer
840 views

datetime picker, timestamps and meta queries

I have a custom meta box with a datepicker. The datepicker outputs 2013-01-17 10:00 in my database for an event that is 01-17-2013 at 10pm PST. $eventlist = new WP_Query(array( 'post_type' => '...
0
votes
1answer
130 views

Getting post by specific date in Advance Custom Field

How can i get movies there are today in cinema, for example my code display the movies in time that shoud apear 16 January,17 January..., how can i display only the movies in this day. Ex: today is ...
0
votes
2answers
99 views

How to get movies by date

Ola, i am building a complex cinema site, and i want to get movies by date Ex: The movies are aded trought post type, I have a custom field name date. How can i retrive the Movie that shoud play ...
2
votes
1answer
185 views

Query by custom dates in UNIX Time

I actually have a custom date registered in UNIX Time in my database like this: meta_key : custom_date meta_value : 1322697600 and the type of the meta key is a longtext I would like to retrieve ...
0
votes
2answers
875 views

How to allow registered users to submit the form only 5 times per day?

Question Is there a way that my registered users (if they are not the form is hidden so I don't need that) are restricted to submit the form more than 5 times per day, or 20 per month or whatever ...
2
votes
1answer
522 views

Finding difference in days

I want to store the current time using the update_option and then compare it if the set time was 3 days ago. I want to know in what format I should store the time? and then how can I compare it with ...
3
votes
1answer
951 views

Is it safe to use 'date_default_timezone_set' in plugin file?

I am using a sitemaps plugin which in very complex ways sets the timezone of <lastmod> (i.e. last modified time) for posts to GMT. Temporarily, until the plugin developer fixes it, I need to ...
2
votes
3answers
3k views

Why time functions show invalid time zone when using 'c' time format?

These are the functions I use in my theme to display the "entry-meta" which includes published and last modified dates (among others) of an article: // Shows Author and Published Date if ( ! ...
3
votes
1answer
174 views

Add 20yrs to post date, and then query

I would like to know if anyone knows a way of adding a timeframe (say 20 years) to the datestamp on a set of posts, and then running a query on the loop which uses the new date? Basically what I want ...
0
votes
2answers
1k views

how to compare different timestamps in wp-query for events custom post types?

I have a custom post type with custom metaboxes (as seen on wptheming.com) and would like to make a query to show upcoming events, say in the sidebar, where past dates are left out. But I need a ...