Yeah, sorry, it's the UNIX_TIMESTAMP() function you want.
FROM_UNIXTIME() will convert a Unix timestamp to a MySQL timestamp,
also. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

> -----Original Message-----
> From: Don Read [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 24, 2003 4:30 AM
> To: L0vCh1Y
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] Re[2]: [PHP-DB] mysql timestamps
> 
> 
> On 24-Mar-2003 L0vCh1Y wrote:
> >
> >
> > JWH> SELECT TO_UNIXTIME(your_column) FROM table ...
> >
> >
> > It doesn't work... MySQL returns error - what could be trouble in? I
> > also tried
> >
> > SELECT TO_UNIXTIME(foo) AS bar FROM baz
> >
> > But it's look like it doesn't know such function :\.
> >
> > I tried table in next types: TIMESTAMP,DATETIME.
> >
> >
> 
> There's no such function in MySQL but there is UNIX_TIMESTAMP():
> 
> localhost.dread$ grep TO_UNIXTIME $MANUAL
> localhost.dread$ grep UNIX_TIMESTAMP $MANUAL
>      `RAND()'. You can, for example, use `UNIX_TIMESTAMP()' for the
>      `UNIX_TIMESTAMP()'.  Other functions operate on the formatted
> `UNIX_TIMESTAMP()'
> `UNIX_TIMESTAMP(date)'
>      `UNIX_TIMESTAMP()' is called with a `date' argument, it returns
> 
> <snip>
> 
> --
> Don Read                                       [EMAIL PROTECTED]
> -- It's always darkest before the dawn. So if you are going to
>    steal the neighbor's newspaper, that's the time to do it.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to