|
Posted by Rik on 01/21/07 00:35
Simon Harris wrote:
> I just tried this...
> strftime("%a, %d %b %Y %H:%M:%S %z",row{'dateUpdated'}) which did the
> same thing.
>
> Dont geddit.
date() expects a timestamp, which is an integer. You 'date' string was cast
to an integer (2006), and 2006 seconds is 33 minutes and 36 seconds. Add
that to the epoch (01-01-1970), adjust for the timezone (+ 1 hour) and
voilΰ, that's the date you got. You have to get your string to a timestamp,
and as it's mysql, I'd suggest you let mysql handle it:
SELECT UNIX_TIMESTAMP(`date`) as 'date; etc....
And you're good to go.
--
Grtz,
Rik Wasmus
[Back to original message]
|