Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RSS time format

Status
Not open for further replies.

JamesGMills

Programmer
Aug 15, 2005
157
0
0
GB
So the standard date/time format for RSS feeds is

Mon, 23 Mar 2009 17:32:59 +0000

Whatever that is called...

So its easy enough to make that format to make an RSS feed/item but what about when reading them in?

I thought this would work:

INFO: $value['created_at'] = Mon, 23 Mar 2009 17:32:59 +0000


$myDate = strtotime($value['created_at']);
echo date('Y-m-d H:i:s', $myDate);

But I get 1970-01-01 00:00:00

I am sure I used to use this method?

------------------------
 
Hi

I would say, it works for me. You also have those quotes, right ?
Code:
[blue]master #[/blue] cat php.php 
<?php

$value['created_at'] = [COLOR=red pink]'[/color]Mon, 23 Mar 2009 17:32:59 +0000[COLOR=red pink]'[/color];

$myDate = strtotime($value['created_at']);

echo date('Y-m-d H:i:s', $myDate);

?>

[blue]master #[/blue] php php.php 
2009-03-23 19:32:59

[blue]master #[/blue] php --version
PHP 5.2.9 (cli) (built: Mar  2 2009 20:51:21) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

Feherke.
 
I was being stupid, I have it working now... sorry... I usually wait a day or two before I start asking questions because its usually a spelling or something...

Thanks

------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top