Re: [PHP] Convert a timestamp to RFC822??

2005-09-11 Thread Kevin Waterson
This one time, at band camp, Brian Dunning [EMAIL PROTECTED] wrote: I get my timestamp from the db in this format (I don't have control over this): 2004-05-14 13:24:48 I need to convert it to RFC822 to make it a valid RSS pubDate field like this: Wed, 02 Oct 2002 13:00:00 GMT

[PHP] Convert a timestamp to RFC822??

2005-09-10 Thread Brian Dunning
I get my timestamp from the db in this format (I don't have control over this): 2004-05-14 13:24:48 I need to convert it to RFC822 to make it a valid RSS pubDate field like this: Wed, 02 Oct 2002 13:00:00 GMT How can I do that? I'm tearing my hair out here (what's left)... :) -- PHP

Re: [PHP] Convert a timestamp to RFC822??

2005-09-10 Thread Niels Ganser
Usually you can use a function in your SELECT statement to change the format of your timestamp. In MySQL it's DATE_FORMAT [1]. Otherwise use PHP's Date and Time Functions [2]. You could for instance extract the ingredients of your database's timestamp with strptime [3] and reformat it with

Re: [PHP] Convert a timestamp to RFC822??

2005-09-10 Thread Jordan Miller
we *just* had a post similar to this. It's easy, just use the date() and strtotime() functions: $timestamp = '2004-05-14 13:24:48'; $RFC_formatted = date('r', strtotime($timestamp)); done! Jordan On Sep 10, 2005, at 11:14 AM, Brian Dunning wrote: I get my timestamp from the db in this