mcmuney Posted April 4, 2009 Share Posted April 4, 2009 I use a script that generates the RSS xml feed, but for whatever reason, all dates appear as Wednesday, December 31, 1969 3:00 PM: $item->pubDate=date("F j, Y, g:i a"); $item->date = $event["added"]; Any ideas? Link to comment https://forums.phpfreaks.com/topic/152523-date-issue/ Share on other sites More sharing options...
animuson Posted April 4, 2009 Share Posted April 4, 2009 Are you trying to format the $event["added"] date into the format specified in pubDate? $item->pubDate should be stored as today's date and $item->date will be whatever $event['added'] is (whether it be a UNIX timestamp or a pre-formatted date). What exactly is the $event['added'] date and what date are you trying to display? Link to comment https://forums.phpfreaks.com/topic/152523-date-issue/#findComment-801209 Share on other sites More sharing options...
mcmuney Posted April 4, 2009 Author Share Posted April 4, 2009 $event['added'] is the date of each article was added, which is the date I want displayed. Thanks. Link to comment https://forums.phpfreaks.com/topic/152523-date-issue/#findComment-801245 Share on other sites More sharing options...
animuson Posted April 4, 2009 Share Posted April 4, 2009 So then you would want to use it inside the date function. $item->pubDate = date("F j, Y, g:i a", $event["added"]); Assuming it's a UNIX timestamp (which you never actually confirmed), it will format the date using the given date format. Link to comment https://forums.phpfreaks.com/topic/152523-date-issue/#findComment-801250 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.