Questions tagged [timestamp]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
21 views

Measure time in ONLY HOUR format

I need to change the timeformat in this column to be in hours, not measured in seconds and minutes. This meaning that 30 minutes should be measured in 0.5 hours and so on. I think I need to edit this ...
1
vote
1answer
7 views

wordpress convert timestamp to date not correctly

I use wp_date() function to convert and show dates with hours and minutes. wp_date( 'Y/m/d - H:m:s',1598205923, 'Asia/Tehran' ) My problem is it shows Y/m/d correct. the hour is ok. but it shows m:s ...
0
votes
0answers
33 views

Time Stamp In A Wordpress Post Title That Does Not Keep Refreshing

I have a short-code that uses PHP to echo a time stamp ala: 1595140137 When I use that short-code as the default post title in new post, the post title changes with each page refresh, and in the ...
0
votes
0answers
13 views

Deleting guests profile users after 1.5 hours

I need to automatically delete the users that are subscribed through a wpforms after 90 minutes of being created. Users created this way are marked as "invitados" on the profile. I found ...
0
votes
1answer
38 views

Learndash: Customize user enroll time

we use the learndash LMS and want to let users get access to lessons everyday at 6am with enrollment based access. For this purpose the LMS stores the enrollment time of every user in the db usermeta ...
0
votes
1answer
14 views

Cron task with scheduled timestamp in the past

I´m doing some setting to enable/disable a cron task and choose a time to run this task. When I disable the cron task and enable it after without changed the time, my timestamp is in the past and make ...
0
votes
1answer
62 views

Change pubDate in rss feed in another format

In the default wordpress rss feed the element <pubDate> is <pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate> ...
0
votes
0answers
15 views

How do I check if a post was published yesterday?

By using get_the_time(Yd)===current_time(Yd), I can check and customize styling of posts published today. How to check if post was published yesterday? Any idea would be appreciated.
1
vote
1answer
15 views

Customize Time Stamp

I'm using this nifty timestamp function that makes the post date "1 day ago" and "five minutes ago" etc. However after a few days I want it to switch to the actual date it was written so for example: ...
0
votes
1answer
102 views

possibility to control embedded video timeline with buttons and links external to the player

I am a designer working on a Wordpress website, currently, I need to make a page where there can be displayed an external video (can be from almost any URL) but I want to include some functionality ...
0
votes
1answer
21 views

Query not work for current taxonomy

Hi i want to show current taxonomy post type count by month but it show total post count istead of current tax. please help me. i am trying to solve this problem almost 3 weeks. <?php $...
1
vote
1answer
53 views

Update all comments time to random dates?

I found this code snippet which randomly changes all the dates for all posts. (Original Post : Update existing post dates to random dates ) <?php /** * Plugin Name: WPSE 259750 Random Dates * ...
0
votes
1answer
155 views

strtotime not working

So, have a plugin that's a bit busted, it's meant to do a count down till next days opening hour. It seems to be adding on an additional 1.5 hours, i've tried a few things and nothing seem to to have ...
0
votes
1answer
31 views

Count time from registration date to today

I would like to add to the user profile the time from registration to the current day in the format: With us: 7 years 3 months 2 weeks 6 days OR With us: 1 year 1 month 1 week 1 day Me a bit ...
1
vote
1answer
419 views

display month in french in wordpress/php?

I am working on a php code as shown below: <?php <time datetime="<?php echo esc_attr(date_format($ts, 'H:i d-m-Y')) ?>" data-timezone="<?php echo esc_attr($tz_param) ?>"><?...
0
votes
1answer
77 views

Update existing post times to random times?

I have found a code here that will randomize the date of all posts to a random date. Here is the code that someone has posted: <?php /** * Plugin Name: WPSE 259750 Random Dates * Description: On ...
-1
votes
1answer
21 views

one time visit to the page

I want to set up a page with PayPal subscription gate away to my members area. It's a simple page with PayPal button which offer discounted subscription price for the chosen customers only. ...
0
votes
1answer
199 views

Get system timestamp in wordpress

My system timezone is UTC+1, MySQL is using this timezone and it's ok. Now I want to get the same timestamps in WordPress. As you know, WordPress modifies the current timezone so time() returns UTC-...
0
votes
1answer
10 views

Can't add to time? [closed]

What's the best way to add to time()? For example: time() + 5 will return 5, not the current unix timestamp with 5 added to it. Any ideas? Thanks
0
votes
0answers
24 views

Timezone for Plugin

I'm using these two lines: $expires = strtotime( $_POST['expire_date']); if($expires < time()) to test the time in the name=expire_date form against GMT time. But no matter what I do my expire ...
0
votes
1answer
41 views

How to get Unix Local Time?

I have a given time and I'd like to confirm that is AFTER the current time. $expires_epoch = strtotime($_POST['expiry']); if($expires_epoch < current_time('mysql')){ ...do stuff... This snippet ...
0
votes
1answer
312 views

How do I output user_registered time in my correct timezone?

I am currently using Wordpress, and an element of user_registered returns the time of registration of the user. I have set the correct timezone, but don't know how to get the user_registered output to ...
2
votes
1answer
1k views

How to get time difference between publish date and now?

I want to get time difference like "posted 2 days ago". I know you can use the following to get the difference. human_time_diff( get_the_time('U'), current_time( 'timestamp' ) ) . ' ago'; But ...
0
votes
1answer
219 views

Change wordpress current_time function to different timezone

I'm using plugin to set the earliest possible date for order delivery in woocommerce. Piece of code below: $current_time = current_time( 'timestamp' ); if( $prdd_minimum_delivery_time != '...
1
vote
0answers
16 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
252 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 ...
1
vote
1answer
49 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 ...
2
votes
0answers
31 views

Is there a reliable way to keep track of how long a WordPress theme has been active?

I want to keep track of how long a specific WordPress theme has been active, not just installed. The end goal being I want to display a notice after a user has created x number of posts and the theme ...
0
votes
1answer
259 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 ...
2
votes
2answers
1k views

Display date only once for a each set of posts relating to that date

The following loop works great for me in getting posts with a given date with the use of the_time(...): <?php $myPost = new WP_Query( array( 'posts_per_page' => '50', 'orderby' =>...
0
votes
2answers
525 views

Function Reference/human time diff for future posts

Right now I've got future posts displayed on my site, and I was using this code on each post to show when it was published. <?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ...
1
vote
0answers
37 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
2answers
766 views

Human Time Diff, change mins to minutes

On my WordPress site, I am using the human time difference for the post date. If you have a post that was posted 59 minutes ago or under it appears as posted 1 min ago, 5 mins ago, or posted 35 mins ...
-2
votes
2answers
242 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
4answers
3k views

current_time('timestamp') is wrong

I put my timezone in America/Lima ( Setting > General ) But current_time('timestamp') show other datetime. For example: Now in Lima it is 2015-10-25 12:01:00 but current_time('timestamp') says : ...
0
votes
1answer
93 views

How to add a timestamp to the exported WXR filename?

I have no working code example for this, so I'm hoping to not get blasted for an an inappropriate question... Being able to add append a timestamp to WP xml exports (WXR) would be useful. I assume ...
0
votes
2answers
148 views

How to show different timestamp

I would like to show published time "Posted 4:15pm" for the first 24 hours, after 24hours show full published date and time "September 27, 2016 at 4:15pm" Any suggestions? Thanks in advance
-1
votes
1answer
53 views

Can someone explain why wordpress uses two column for storing time values?

I see two table columns in wordpress tables for time values. Examples: post_date post_date_gmt post_modified post_modified_gmt comment_date comment_date_gmt What is the reason behind storing ...
1
vote
2answers
1k 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, ...
2
votes
1answer
4k 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
1answer
2k 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
61 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. ...
6
votes
1answer
14k 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
998 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 ...
3
votes
1answer
878 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
202 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
1k 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
30 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
124 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
1k 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( ...