Re: timestamp and NOW('') in php / mysql
| From: | Andreas Pour | Date: | Sun, 06 Aug 2000 02:35:54 +0000 |
| Subject: | Re: timestamp and NOW('') in php / mysql | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-10294@lists.php.net to get a copy of this message | ||
Hi,
In your SELECT statement use "UNIX_TIMESTAMP(time_stamp)" instead of
just "time_stamp".
Ciao,
Andreas
wrote:
>
> use the function <? date("YmdHis") ?> it will have the same output type than
> mysql's NOW()
>
> "Neil M" a écrit dans le message
> <003001bffe40$1598ca00$ba39fea9@VAIOSR1K>...
> Hello all
>
> I have been writing a job tracking system but am having a few problems with
> getting a sensible validation of the timestamps i have set.
>
> i insert a record containing data , one of the fileds is time_stamp with the
> value NOW('')
>
> When i try to compare the mysql NOW('') stamp and mktime() they are very
> very different for e.g. :
>
> <SNIP>
>
> $my_new_time_stamp = mktime ();
> print ("<BR>output new stamp: $my_new_time_stamp");
> print ("<BR>output db value : $myrow->time_stamp");
>
> the output:
>
> output new stamp: 965411494
> output db value : 20000804185021
>
> so am i using the xorrect type of comparison ? probably not.
>
> Any ideas / advice gratefully recieved :)
>
> thx
>
> Neil
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net