Questions tagged [date-time]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
8 views

Future Time for Wordpress-Postings

I would like to generate +5 minutes in Wordpress in publishing, so that all posts that are posted with "publish" actually go online after 5 minutes! Who can help? THANK YOU!
0
votes
0answers
23 views

CMB2 toolkit: Compare 2 Dates and validate the Time

Hello i am using the CMB2-toolkit for Wordpress: https://github.com/CMB2/CMB2/wiki/Field-Types I have a Problem where i have 2 Datetimes, where one is the Starting-Time and the other is the Ending ...
0
votes
0answers
11 views

Serve visitor post time adjusted to their timezone

I want post times to reflect the timezone of the logged in or logged out user on my site. So if I post at 2:43PM London time, I want a user or visitor from Tokyo to see the post time as 11:43PM I'm ...
0
votes
0answers
24 views

Compare ACF Date field to today or yesterday

This is a very simple question, but for some reason having challenges with it. I have set up ACF field group. I wanted to compare a "date field" to the current "today's date" and "yesterdays" date. ...
0
votes
1answer
18 views

How to fix mysql2date() for 5.3.2 version?

When I upgrade Wordpress into 5.3.2 version, a date on a PDF invoice generated by a plugin disapeared. The function mysql2date() which makes the date is a wp function and used in the plugin like this :...
0
votes
0answers
8 views

Pin featured posts to main slide without changing date

I want to make a modification to a slide that appears on my main page, but I don't know how to do that. The site uses the "Carmack" template and here is his template: https://prothemedesign.com/theme-...
0
votes
0answers
12 views

Is it possible to match WP date format in my plugin? [duplicate]

I have a plugin that displays a date in the format October 20, 2019, it is hard coded $dateformat = 'M d, Y' Is it possible to read the date format a person has in WordPress site settings and use ...
0
votes
1answer
12 views

Can't convert ACF datepicker value to DateTime oject - gives me a boolean

I keep getting this error Call to a member function modify() on boolean with this code $date_value = the_sub_field( 'date_string' ); $date = DateTime::createFromFormat('d/m/Y', $date_value); $date-&...
0
votes
1answer
42 views

How can I fetch all the dates from custom fields from various different custom post types and show / list them at one place in ascending order?

I am using wordpress and pods for building a web app. I have created different custom post types like "project" , "task" and "material" and each of them have various different custom date fields. I ...
0
votes
1answer
15 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 ...
0
votes
0answers
20 views

how to select posts in the loop published before x date?

I'm trying to select posts in the loop published before O4/2007 so I can target an html element, I had a way of doing this through a varblock in movable type - I'm kind of imagining this is pretty ...
0
votes
0answers
16 views

How i can change language in ACF plugin?

I need to display the date in another language, but my ACF is not in the right one. How to change, so that I can withdraw in latvian? And how is it possible to edit the date at the output? Just the ...
0
votes
0answers
26 views

date_i18n in wordpress/php

I am working on a html/php code as shown below: HTML/PHP Code: <time datetime="<?php echo esc_attr(date_format($ts, 'H:i d-m-Y')) ?>" data-timezone="<?php echo esc_attr($tz_param) ?&...
1
vote
1answer
115 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
33 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 ...
0
votes
1answer
57 views

Compare meta key to current date in pre get post

I'm looking for a way to compare a string to the current time. I found this question "pre_get_posts filter using numeric meta_query comparison (from dates)" and I'm confused as to get it to work. $...
0
votes
1answer
122 views

Is a MySQL DATETIME or TIMESTAMP value retrieved through $wpdb in UTC?

I have a custom MySQL table with two columns that look like this: `timestamp_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, `datetime_created` DATETIME DEFAULT CURRENT_TIMESTAMP, When retrieving ...
0
votes
1answer
135 views

How to pull date/time in french format for wordpress post?

I am working on a wordpress post in which I want the date/time in frech format as shown below: ENGLISH By FJ Published April 9, 2019 at 4:05 p.m. Last updated April 9, 2019 at 4:14 p.m. FRENCH Un ...
0
votes
1answer
27 views

Incorrect display of bbpress forum topics & replies

not sure if this is the correct place to ask, but I'm scratching my head at this. We're making a demo wordpress site with a forum, and because the old site has a locked down forum, we can't export ...
0
votes
1answer
75 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-...
1
vote
2answers
55 views

Print last modified date only on posts

I'm printing the last modified date via functions.php with the following code function wpb_last_updated_date( $content ) { $u_time = get_the_time('U'); $u_modified_time = ...
-2
votes
1answer
798 views

Display Current Time using shortcode

I am using the below code to display current time in php supported time zones: <?php date_default_timezone_set('Asia/Kolkata'); $currentTime = date( 'd-m-Y h:i:s A', time () ); echo $currentTime; ...
1
vote
1answer
9 views

Set the publication date independent of the scheduled publication date

I want to write a post today (2019-01-15) I want to schedule the publication for the future (2020-09-03) I want the published date to reflect when it was originally written - so it appears as example....
0
votes
1answer
18 views

How do I make a page not visible at a certain time? [closed]

I have a product page and I wish to change the prices twice in a day automatically. I want it to repeat forever. So I have 2 options : schedule the page or the products. But I couldn’t find any plugin ...
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
23 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
28 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
50 views

How do you update post date (year only) in a separate custom field?

I would like to update all my posts with a custom field that stores the year the post was published. The "year" value will obviously be retrieved from the post's date meta data. I will then use the ...
0
votes
1answer
41 views

WP_CRON issue with UTC and local time

I have made a plugin to change some user metadata on a schedule according to the wp_cron function. If the current time is say between their lunch hours (that is in their user profile as date('g:i a', ...
0
votes
1answer
377 views

tribe_get_start_time displays the current date and time on other post types than tribe_events

i am displaying posts selected by an ACF relationship (with object format) on a page, including custom posts like tribe_events. I want to display the date and time on the tribe_events posts, but not ...
0
votes
1answer
51 views

3 different times on my Wordpress website

I have a wordpress website hosted at Hostgator (Brazil). The server shows the current correct time (in daylight saving time). In this example, the correct time is as below, ie 13h (America / São Paulo)...
1
vote
1answer
722 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
284 views

Render the published date/time formatted in ISO 8601 using Timber (.twig)

I am setting up Google Tag Manager's Data Layer and I have a .twig as my header file. I need to produce the date and time of the post in ISO 8601 format. "datePublished": "{{post.date}}" This ...
1
vote
0answers
52 views

UTC/local time in Worpdress

Problem is the one several post already has displayed : I've updated one of our wordpress from 4.6.1 to last version. Local time of server is not UTC and WordPress inside general options show a UTC ...
1
vote
0answers
24 views

Convert CST published date time to MST timezone

My WordPress install is using "Chicago" timezone as the general setting, would like to convert published date time to MST timezone in one of my sections (front-end display) Any suggestions? Thanks in ...
1
vote
2answers
285 views

Creating a function within functions.php to change the date

I'm using the PODS WordPress Framework which is amazing. I created a template with one of the fields publishing the date of an event which is done through a simple 'magic tag' like this {@...
2
votes
1answer
2k views

Use meta_query to display events by date in custom field

I'm working on a template for a specific category archive of the custom post type event. I need to make a query that shows future and ongoing events, ordering by a date in custom field. $termName = ...
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
220 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
1k 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
76 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
1answer
601 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
34 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
819 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
1k 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
361 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
16 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 ?
1
vote
1answer
43 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
64 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
47 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 ...

1 2 3 4 5 6