Skip to main content

Questions tagged [timestamp]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
20 views

Show Element at Certain Time in Wordpress

I'm trying to use the below code to show a button on Sunday mornings, but I dont want to use "date_default_timezone_set()" because it rewrites the Wordpress date and then the events show the ...
Kelsey Curran's user avatar
1 vote
1 answer
38 views

How to compare Event period with Week period using get_posts(), meta_query, relation and compare

I have many posts, each post is an event with a period . This period can be 3 hours, 3 days, 15 days, 3 month. I defined the start time of event with start_timestampevents and the end with ...
imagIne's user avatar
  • 83
0 votes
0 answers
49 views

Short custom plugin to send email to users

I have created a very short plugin that is working with a cron job running the below function once every 3 months. I will explain the steps inside the function: Fetching Producers(a list of users ...
Honoluluman's user avatar
0 votes
0 answers
20 views

wp_query loop how to also display post second time with specific condition

I filtered posts by period : from "current week"* , from * + 1 (following 2nd week), from * + 1 + 2 (following 3rd and 4th week) and from 1st day of current month * 12 month. For the last ...
imagIne's user avatar
  • 83
0 votes
1 answer
265 views

WP_Query filter Posts by timestamp event (range start and end) and by month (next 12 month)

I would use together meta_query and date_query but it seems it's not possible . What I'm looking to do : (display next 12 month from current month) : for each April 2023 If date range event (start ...
imagIne's user avatar
  • 83
0 votes
1 answer
49 views

Why does wp_query only display the most recent post when using order ASC?

Problem: I want to list posts of a category, displaying those with custom-field 'start-date' after today (in the future) with order ASC. When this is done, I want to display all those with start-date ...
hal's user avatar
  • 35
1 vote
2 answers
4k views

create timestamp links to jump to specific times on rumble videos

I am trying to allow visitors to seek specific times on the embed rumble video inside the wordpress post by clicking to timestamp links. I can do it for youtube videos using Skip to Timestamp plugin ...
Johnny's user avatar
  • 111
0 votes
0 answers
243 views

set_object_terms action hook based on the function in the published CPT

I want to change the term in the custom taxonomy from the set of time intervals. CPT = job, taxonomy = current-status, term = ongoing The below code is not working and I don't know the missing code. ...
praba's user avatar
  • 13
0 votes
1 answer
2k views

How to get User Time Zone in Wordpress?

how can I get user Time Zone in Wordpress if you don't know where the user comes from. Let's say if a user is in USA I need to get USA Time Zone, if the user is in Germany I need to get Germany Time ...
Besart's user avatar
  • 101
0 votes
0 answers
259 views

the_modified_time showing wrong date

I have an wordpress self-hosted installation that is over 10 years old. I was updating the template files to show the last modified date instead of the published date for my posts. Old snippet: <...
Peter-L's user avatar
  • 59
0 votes
1 answer
103 views

current_time function incorrect in plugin and PHP, not in WordPress admin

I had to reboot my server due to recurring server errors (which I couldn't find a reason for). Since rebooting, echoing current_time( 'timestamp', true ) shows the time as 14 hours before my current ...
Badger's user avatar
  • 193
0 votes
2 answers
48 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 ...
Sindre Fjellestad's user avatar
1 vote
1 answer
349 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 ...
D.JCode's user avatar
  • 201
0 votes
0 answers
66 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 ...
mobilestimulus's user avatar
0 votes
0 answers
35 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 ...
Victor Vazquez's user avatar
0 votes
1 answer
809 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 ...
Steve's user avatar
  • 150
0 votes
1 answer
189 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 ...
J.BizMai's user avatar
  • 870
0 votes
2 answers
2k 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> ...
Honoluluman's user avatar
1 vote
1 answer
102 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: ...
RLM's user avatar
  • 247
1 vote
1 answer
1k 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 ...
JMB's user avatar
  • 31
0 votes
1 answer
36 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 $...
Raminer's user avatar
  • 33
1 vote
1 answer
272 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 * ...
katyp's user avatar
  • 11
0 votes
1 answer
604 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 ...
Gareth Thomas's user avatar
0 votes
1 answer
175 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 ...
cogorihaw's user avatar
1 vote
1 answer
2k 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) ?>"><?...
user5447339's user avatar
0 votes
2 answers
387 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 ...
SpiritFly's user avatar
-1 votes
1 answer
264 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. ...
Vit's user avatar
  • 1
0 votes
1 answer
534 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-...
Epsiloncool's user avatar
0 votes
1 answer
12 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
Sal's user avatar
  • 153
0 votes
0 answers
35 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 ...
Sal's user avatar
  • 153
1 vote
1 answer
151 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 ...
Sal's user avatar
  • 153
0 votes
2 answers
1k 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 ...
Theo's user avatar
  • 1
2 votes
1 answer
5k 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 ...
Mais_Cule's user avatar
1 vote
1 answer
469 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 != '...
Łukasz Gręźlikowski's user avatar
1 vote
0 answers
24 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 ...
Ruben's user avatar
  • 19
2 votes
1 answer
413 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 ...
SHA3.org's user avatar
  • 119
1 vote
1 answer
54 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 ...
Mark Nielsen's user avatar
2 votes
0 answers
38 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 ...
Jeremy Muckel's user avatar
0 votes
1 answer
416 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 ...
Riyas Muhammed's user avatar
2 votes
2 answers
2k 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' =>...
klewis's user avatar
  • 857
0 votes
2 answers
646 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') ...
mwz's user avatar
  • 23
1 vote
0 answers
44 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 ...
Kevin Nugent's user avatar
0 votes
2 answers
1k 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 ...
user7548188's user avatar
-2 votes
2 answers
518 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 ...
anandmongol's user avatar
0 votes
4 answers
4k 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 : ...
Alexander's user avatar
0 votes
1 answer
236 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 ...
glvr's user avatar
  • 881
0 votes
2 answers
193 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
choche's user avatar
  • 1
-1 votes
1 answer
84 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 ...
Giri's user avatar
  • 109
1 vote
2 answers
2k 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, ...
KDX's user avatar
  • 183
3 votes
1 answer
8k 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 ...
anandmongol's user avatar