Questions tagged [timestamp]
The timestamp tag has no usage guidance.
109
questions
1
vote
1
answer
29
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 ...
0
votes
0
answers
45
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 ...
0
votes
0
answers
15
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 ...
0
votes
1
answer
166
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 ...
0
votes
1
answer
20
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 ...
1
vote
2
answers
3k
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 ...
0
votes
0
answers
211
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. ...
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 ...
0
votes
0
answers
217
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: <...
0
votes
1
answer
85
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 ...
0
votes
2
answers
44
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
1
answer
302
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
0
answers
65
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
0
answers
34
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
1
answer
721
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
1
answer
155
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
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>
...
1
vote
1
answer
83
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: ...
1
vote
1
answer
941
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
1
answer
34
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
1
answer
263
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
1
answer
579
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
1
answer
173
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
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) ?>"><?...
0
votes
2
answers
366
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
1
answer
193
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
1
answer
463
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
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
0
votes
0
answers
33
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 ...
1
vote
1
answer
147
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
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 ...
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 ...
1
vote
1
answer
450
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
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 ...
2
votes
1
answer
397
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
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 ...
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 ...
0
votes
1
answer
407
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
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' =>...
0
votes
2
answers
631
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
0
answers
43
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
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 ...
-2
votes
2
answers
503
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
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 : ...
0
votes
1
answer
229
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
2
answers
188
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
1
answer
77
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
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, ...
3
votes
1
answer
7k
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
1
answer
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(){...