The date-time tag has no wiki summary.
0
votes
1answer
13 views
setlocale for date
So I purchased a premium wordpress theme, but I can't get through its Polish localization - the dates outside the_time or the_date are displaying in English (default server's language). I read that I ...
0
votes
0answers
5 views
How to display the date in my own language [duplicate]
Hy, how can i display the date in my own language.
I neeed to get something like this: 21 Iunie 2013
Language ROMANIAN
1
vote
1answer
26 views
Unable to set right time in admin and frontend template
When I run a simple php file called test.php (placed in the root of the wp installation) that contains something like that:
<?php echo date('H:i:s'); ?>
The result is right: 15:30:00 and the ...
-3
votes
2answers
29 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 ...
0
votes
1answer
20 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?
1
vote
1answer
25 views
“is_new_day()” alternative for years?
I don't believe there's a is_new_year() function in WordPress, as an alternative for is_new_day(). I'm trying to display the year only once for each set of posts, what would be the best way to do ...
1
vote
2answers
70 views
Echo Messages By Checking current_time()
Before asking for help I would like to clarify that I don't have advanced skills on PHP. What I want to achieve is to display different messages for every period of time that I set (I need this to ...
0
votes
1answer
81 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 ...
0
votes
1answer
32 views
Format Date for Manual Insertion into post
I have the following $mydate = "26 January, 2012, 5:05 AM";
I want to format this date properly so I can insert it into a post_date. Is there a simple way to do it?
$post_ information = array (
...
2
votes
2answers
65 views
Get date of last update outside of loop
I'm trying to figure out how to display the date that a post was last updated outside of the loop. I'm able to display the published date using get_the_time() but there doesn't seem to be a "loopless" ...
1
vote
1answer
175 views
Converting timestamps to local time with date_l18n()
I've got a WordPress cron job that sends an email periodically and saves the timestamp when it was sent as an option, and I'd like to display a date on a settings page. Something like, "The last ...
2
votes
1answer
221 views
Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
QUESTION
This is following a previous question that was graciously answered by Milo earlier here - How to sort CPT by custom meta value (date), and return posts month by month
In short, I'm having ...
0
votes
2answers
152 views
How to get date for each post?
while (have_posts()) : the_post();
//some html
<li class="icon-date"><?php the_date('Y-m-d');?></li>
<li class="icon-time"><?php the_date('H:i:s');?></li>
With ...
0
votes
1answer
404 views
Advanced Custom Fields and date picker, show posts only if the day is today no matter the year
I've created a site made just with custom fields about famous people in sport.
In the post page I've a born date and a death date field using the data picker.
What I'm trying to achieve is to show ...
1
vote
2answers
44 views
Changing “submitted on date” of comments
How do I change the "submitted on date" of a comment to an earlier date? I want to change the date that is displayed to the readers. As far as I know, I can change the date of the post by clicking the ...
3
votes
3answers
132 views
Running WP Cron on specific local time
The scenario is to run insert_post function every midnight (00:00) of local time. Must run daily on weekday.
function add_daily_task(){
if((date('l', time()) != 'Saturday') || (date('l', time()) ...
0
votes
2answers
85 views
Can i show items based on the day with php?
I have a code on my site that displays different headers for different post types using the if ( get_post_type() == 'post type here' ) { code
but is there a way i can do this for days of the week?
...
0
votes
1answer
175 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
72 views
Order posts by month - in custom taxonomy template
I'm trying to show all posts posted under the month, so
2012
December
post 1
post 2
November
post 1
post 2
The posts are to appear under my custom taxonomy template, so taxonomy-pubyear.php and ...
1
vote
1answer
84 views
Displaying custom field according to date
I am not sure whether this is an Advanced Custom Fields-related question, or a general PHP question, so I have also posted this to the ACF support forum, for those of you who are also looking for ...
2
votes
1answer
205 views
How to List Events by Year and Month Using Advanced Custom Fields?
I have a custom post type "Kalender_item" with a custom Date Field (YYMMDD). I want to list all the posts on a page sorted by Year and Month.
For example:
November 2012 (all events that occure ...
1
vote
1answer
92 views
Show 1 post and after a specific date show the next one
I used the following query to have only 1 post published on the homepage from a particular category:
<?php if ( have_posts() ) : ?>
<?php ...
0
votes
2answers
452 views
Change date number to another language/script?
I previously was able to change the numbers of the date and time (into a number and date system of another language, like Khmer) for each post using a script like this in my functions.php:
function ...
0
votes
1answer
86 views
Comparing Time with the_time();
I am trying to make a function that will check the time associated with a future event (cpt) with the current time, to see if the event has past. When I first collect the time it is in seconds and I ...
1
vote
0answers
49 views
Time Issue xx hours ago
I'm facing a strange issue, first time in my life :)
After publishing a post/page/custom post type, it's tell that published 10 hours ago. It's happening always, for all posts.
As I've deployed a VPS ...
0
votes
1answer
41 views
How can I compare publish and update dates for a single post?
In my theme, I'd like to display the publish date and (only) if the post was updated after the publish date, also display the updated date. The code in my theme now looks like this:
*/ stuff above ...
0
votes
1answer
30 views
Change the counter in terms of date
If I have a post or submit a date-field, I would like the counter to say 'this is in 3 days time'.
i.e - on my site at the moment, (see here: http://www.universitycompare.com) I have dates for the ...
0
votes
1answer
45 views
Randomizing Post Links Outside of Loop - No Author or Date
I'm developing a home page that is a mishmash of a bunch of information, including a random smattering of several categories, including blog posts (category 192 in the code below)
I'm obviously not ...
0
votes
1answer
160 views
How to handle dates, trying to calculate time since a post
I am trying to create a "time since" post display so when someone views a post they will see "posted about a week ago" instead of the date.
I've tried a few things but to no avail and I think it is ...
2
votes
1answer
94 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 ...
1
vote
1answer
99 views
Timezone UTC to PST
we are trying to figure out what's happening with our site's timezone. On general settings it shows that local time is correct while showing the UTC time next to it. The locale we have it as Los ...
1
vote
0answers
63 views
Posts published last 10 minutes
i have a "featured" section on home page.
i want to hide this section after 10 minutes of post publish time.
here is the code, i am using.
problem is that it hide the "featured" section after 12 ...
1
vote
1answer
87 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 ...
0
votes
1answer
230 views
Get date function not working
I have a function to get the date. I have input fields and want the date in this fields. But my code is set a wrong date. I set the date in Wordpress settings and on my server. But it is not working. ...
3
votes
1answer
278 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 ...
3
votes
1answer
69 views
How to display date such “x ago”
I want display date based on how much time has passed since, i. e. Posted 12 minutes ago
-1
votes
1answer
277 views
Separately formatting date elements
I am trying to achieve the following look in the time format:
I have for now several issues,
First is that the month and year are not displayed at all,
I use <?php the_date('D'); ?> <?php ...
1
vote
3answers
974 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 ( ! ...
0
votes
1answer
78 views
How to show certain data on certain interval of period
I have three sets of period of time, each with several interval of date:
Event A
Jan 1 - March 1
Dec 1 - Dec 31
Event B
Mar 2 - April 15
Jun 1 - Jul 15
Sept 1 - Oct 15
Event C
Apr 16 - May 31
Jul ...
0
votes
1answer
354 views
Date time doesn't show correctly in qTranslate
I've used qTranslate to enable multiple languages on site. It works fine except for date-time for english language. Here are screenshots:
Serbian:
English:
Languages settings looks like:
How ...
0
votes
1answer
256 views
PHP time function ($today) for GMT +1
I tried a lot - But the code at the bottom is always 1 hour behind the local time. It might be a problem of the server-time. But I want to use it for a german website - So I have to set the time to ...
0
votes
1answer
50 views
Comment time is same as the post time
Here is my comments.php: http://pastebin.com/E5bz4aaW
The problem is that the threaded comment (the reply) showing my post date instead if the comment date. I checked in the database and it looks ...
0
votes
2answers
219 views
Setting Event to Expire Using Custom Metabox
Working on a real estate website and setting Open House dates and times using drop downs in a Custom Meta Box. Example drop down below:
<select name="sale_listing_open_house1_start_day" ...
0
votes
1answer
62 views
Query sub subpages based on specific date?
I have an Events section as follows:
⤍ Page 1)
∟ Subpages 2)
∟ Sub subpages
1) Own template, w/o sidebars, but query_posts() and get_title/excerpt() from N°2
2) Other subpages are ...
0
votes
1answer
3k views
Get Wordpress current date/time
In my plugin, I am trying to get the current date/time of the blog into the code but it seems to be returning a odd date/time. If i put a new post on the blog it does show the correct date/time so I ...
3
votes
4answers
4k views
Sorting a query by custom field date
EDIT: Reworded the question for more clarity
I'm trying to sort by custom meta box data, which I am converting to a date using the strtotime function, but I'm having some difficulty.
My chief ...
0
votes
1answer
540 views
Time & Date on Post - Time Ago Custom Function
I'm using the following custom function to display the timestamp for a post as posted "X minutes ago" or "X days ago" for 14 days and then this changes to the actual date (e.g. 17th December 2010):
...
-2
votes
1answer
45 views
Display the last date, regardless of articles
i would like to display a date on my Blog. I have used this Code for displaying the date:
<?php the_time('l, j. F Y'); ?>
But that uses the time of the latest article. How can i display the ...
0
votes
2answers
338 views
Human time difference in months instead of days. How?
I use the following code in my template.
<?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago'; ?>
It shows like 2 days ago, 20 days ago, 90 days ago.
Is there a ...
0
votes
3answers
2k views
Proper formatting of post_date for wp_insert_post?
What is the proper way to define the post date when submitting a post from the front end using wp_insert_post (Trac)?
My snippet now is publishing with the mysql time...
if (isset ($_POST['date'])) ...

