RE: [PHP] Re[2]: [PHP-DB] mysql timestamps
| From: | Don Read | Date: | Mon, 24 Mar 2003 09:30:11 +0000 |
| Subject: | RE: [PHP] Re[2]: [PHP-DB] mysql timestamps | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-140816@lists.php.net to get a copy of this message | ||
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 dread@texas.net
-- 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.