How is $pubdate generated? What happens if you simply echo $pubdate directly?
Main Topics
Browse All TopicsHello Experts - I'm new to WordPress. I've installed an rss widget to display recent posts in the sidebar. I'm trying to get it to format the pubdate to display like this: October 13, 2007 instead of Sat, 13 Oct 2007 15:20:49 +0000
Here's my code:
date('F j, Y', strftime($pubdate));
And it returns: December 31, 1969
I tried just this: date('F j, Y', $pubdate); but it returns today's date for each item. Not sure where to go from here. Thanks for any assistance!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I think it is a timestamp at the time the post was published (although you can alter that timestamp in the editor)
not sure try echoing it
I dont see it listed in http://codex.wordpress.org
@singleton - i probably didn't clearly specify what i'm trying to do - i'm using a widget that allows for a more customized display of an RSS feed - the sidebar widget that comes with WP does not allow much customization. With this widget, I can specify which elements of the feed I want displayed, based on the feed's element name. So $pubdate is actually getting pulled from the feed itself, not from the WP db. And in the feed, pubdate is stored as: (for example) Sat, 13 Oct 2007 15:20:49 +0000
So given that date format, I'm trying to change it. Thanks!
Hi MasonWolf - I have no doubts your code is correct (I've used the date() and strtotime() and strftime() functions with other code - which is why I tried it here, in this WordPress widget. I also tested with echoing the data specifically. After looking through *all* of the widget's code however, I can see that the solution isn't going to be as quick as throwing in that one function, and that I'd have to change quite a bit more in the widget. Ah well. Thanks for your help!
Not one to give up easily, MasonWolf directs betagirl to http://ee-stuff.com and invites her to upload the complete source code for the widget - all while writing in the third person. (C'mon, give me a shot!)
Hi Masonwolf - I've uploaded the file here: http://www.ee-stuff.com/Ex
Thanks for having a look!
strtotime has a string with the time as a parameter http://us.php.net/strtotim
You just have strtotime('pubdate')
Changed line 226 in that file to the above, and I'm still just getting today's date - November 3, 2007 for each post. Another reason why I'm inclined to think that there is other code in this plugin that needs to be changed is because if I use this (literally): $pubdate = date('F j, Y', strtotime($whatever)); I get the same result (today's date). So I think the problem is that the function is not reading in the value of 'pubdate' at this point in the code. And I need it to have that value prior to be able to manipulate it of course.
Business Accounts
Answer for Membership
by: singletonPosted on 2007-11-02 at 13:58:43ID: 20204480
Try http://tutorials.programmi ngsite.co. uk/cstrfti me.php for params for strftime