The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
174 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
98 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 ...
2
votes
1answer
350 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
520 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
693 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
81 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
920 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 ...
2
votes
3answers
2k 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
125 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
636 views

Date time doesn't show correctly in qTranslate [closed]

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
494 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
61 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
328 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
64 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
11k 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 ...
4
votes
4answers
7k 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
897 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
54 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
567 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 ...
1
vote
4answers
7k 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'])) ...
0
votes
1answer
1k views

Media attachment date and post date

I have just migrated a massive site (2500+ users, 5000+ posts/images) to Wordpress using custom code. Basically every post has one image and that image is attached to the post as the featured image, ...
1
vote
1answer
146 views

Calculate future date

I want to calculate a future date based on the date the post is published and use it in the content of a post. I can echo the post publication date using: echo the_date('Y-m-d'); How can I ...
0
votes
1answer
606 views

Display upcoming events in the next 30 days by querying posts with timestamp in custom meta

I have a custom post type "event" which stores a custom meta as a timestamp ($event_date). The date is always in a dd-mm-yyyy format, so I can generate a unix timestamp from this key. The timestamp ...
0
votes
1answer
517 views

How can I wrap html around the output of the_time function?

My current code in functions.php: echo '<div class="post_date">'.the_time('d', '<div class="month">', '</div>').the_time('F', '<div class="day">', ...
1
vote
0answers
461 views

How to remove/exclude specific posts in a category from RSS feeds after particular date [closed]

I want to remove/exclude some posts of a category from RSS feeds after particular date. First of all i want to specify that same requirement i already accomplish for front page posts. I have two ...
4
votes
1answer
2k views

Custom Post Type Archives by Date with Custom Permalink

I'm a bit stuck with getting the custom permalink for custom post type (CPT) archive to work. I've registered my 'press_release' CPT as following: add_action('init', 'press_release_post_type_init'); ...
5
votes
2answers
4k views

Default timezone hardcoded as UTC?

While debugging a plugin I was writing, I noticed that on line 36 of wp-settings.php, the default timezone is hardcoded to UTC with a call to the date_default_set_timezone() function. This means any ...
0
votes
1answer
4k views

Convert a date to ISO8601 date format

This is more of a PHP question than a WordPress one. I have a custom post type event that by default outputs the date as "September 11, 2011 9:00 am" format. I'm trying to format the post in ...
5
votes
2answers
3k views

What's the difference between get_the_time and get_the_date?

Both function returns date and time. What's the difference between them? Do you have any example? Thanks.
0
votes
1answer
158 views

How to change a meta value (of a published post) after X days.?

I have a custom field. I would like to change the text of that custom field after x days. I want something like this: if ( published post is more than 90 days old ) { echo "your post is more ...
2
votes
2answers
383 views

Display future posts?

Is there a way to display posts, scheduled for the future? I want to use the published data as an event date and time, which is obviously in the future. I still would like to use these posts for a ...
0
votes
3answers
616 views

change the year on all of my custom post types?

I need to change the published year on all of a custom post type from 2010, to 2011. What is the quickest way to do it? I have 200 entries, so manual would take hours!!
-1
votes
1answer
117 views

Standard API for rendering a date form

I'm hoping to enhance an existing plugin's setting page by adding an 'end date' form. I know how to add text and other form fields but was wondering if there is standard function that will render a ...
0
votes
1answer
84 views

Timed post and tweet?

I'm new to wordpress. Is it possible to say i would like to make this article public on this day and time AND have wordpress tweet it? Possibly tweeting the subject+link or a twitter msg i add in + ...
1
vote
1answer
284 views

Change the 'published on' text?

I am using the date and time in the post dialogue to log the date and time of future events, and would like to change the text to reflect that. Is there an action hook I can tap into to achieve that? ...
1
vote
1answer
532 views

Wordpress Locale Switching on Accept-Language Header

Is there anyway to get wordpress to automatically switch locales based on the HTTP Accept-Language header? Similar to how ASP.NET can do it with their globalization="auto" config setting. The reason ...
2
votes
1answer
1k views

How to filter a dd/mm/yyyy date from a custom field in a query

I'm trying to build a query in order to sort some posts by a date custom field, where the dates are formatted dd/mm/yyyy. It works by querying the database directly with get_results like in this ...
3
votes
1answer
2k views

Display last login time

I am using this script to get the last time a user logged in function get_last_login($user_id) { $last_login = get_user_meta($user_id, 'last_login', true); echo human_time_diff($last_login) . ...
1
vote
4answers
1k views

wrong php date()?

hey guys, it's weird and I've never experienced that before. I've created a new blog and a custom theme. I'm using <?php echo date("H:i"); ?>in my theme. The time that's put is 2h earlier. ...
2
votes
1answer
1k views

How to Delete Old Comments by Date?

I run a contest/giveaway blog at www.mommylivingthelifeofriley.com and currently have over 160,000 comments on 1100 posts. I would like to find a way to delete all comments from my site which are ...
3
votes
3answers
1k views

Set Custom Post Type title to the Post's Date

I have a custom post type, called 'status' and I have disabled 'title' in the post type. Right now it's setting all posts to have the title "Auto Draft". I want to set up a way to set the title to be ...
1
vote
1answer
1k views

SQL query to delete comments older than 90 days?

I'm working on a site that has 150,000 comments with an obvious hit in performance; is there an SQL query that can delete all comments older than say 90 days? They're not spam comments, and they are ...
2
votes
2answers
2k views

How would I bulk change posting date?

How would I bulk change posting date? I want to change about 20 post publish dates at a time in one click
3
votes
1answer
467 views

Custom Post Type Archives by Date (stored as meta value) WP3.1

I would like to implement date-based archive functionality (similar to original WP Archives widget functionality) for custom post type (CPT). What makes it difficult is the fact that I need to group ...
2
votes
1answer
2k views

custom field value date convert to unix timestamp problems

For some reason, I'm having difficulty converting a date value stored in a meta field to a unix timestamp (and back again). If I save the date as a string it all works fine, but if I convert it to a ...
2
votes
2answers
204 views

How do I create a dynamically-updated copyright statement?

I'd like to find an optimized, WP_Query-safe method for generating a dynamically-populated copyright statement for the bottom of my themes. That is to say, I'd like to check the date (by year) of my ...
0
votes
1answer
401 views

wp_dropdown_categories by date?

Is there any way to specify a time period for wp_dropdown_categories or wp_list_categories or something else...? I want to create a archive page, so that if your in the archive of 2010, you'll see ...
0
votes
1answer
230 views

Post navigation using date

On my site: www.finmand.dk/almastofa/nyheder (a danish site) I have used this code to navigate between the post: <?php foreach(get_the_category() as $category) { $thecat = $category->cat_ID; } ...
1
vote
2answers
7k views

How to get the date of a post in WordPress, so I could use it in a script?

I'm very new to WordPress. I need to get the date of a post and compare that date to a specific date (04/01/2011), so add some banners and stuff to every post created "after" that pivot date. But the ...
0
votes
1answer
643 views

Adding a class to last post in the_date

I'm using <?php the_date('l jS F Y','<h2>','</h2>'); ?> inside the loop in order to group/sort posts by date. This all works great but I would like to add a different class to the ...