Re: simple date/now() question
| From: | Jason Davidson | Date: | Tue, 28 Sep 2004 16:13:09 +0000 |
| Subject: | Re: simple date/now() question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-198081@lists.php.net to get a copy of this message | ||
Just select out records that are NOW() - (24 * 60 * 60)....or if you use
datetime field instead of timestamp, which is prolly better off ofr many
reasons, use DATE_SUB(NOW(), INTERVAL 1 DAY) or something similar. you
can get timestamps from datetime fields, if that is an issue for you...
Jason
Mag <genphp@yahoo.com> wrote:
>
> Hi,
> I have a field in the db called
>
> join_date_time(timestamp 14)
>
> which has data like:
>
> 20040928170708
> 20040916163619
> etc
>
> This keeps track of the customer join date, I need to
> know if the client has joined in the last 24hrs or
> more than 24hrs back...
>
> Anybody have a function for this? or can help? am a
> bit confused because reading on google I see that
> there are 2 possible problems as MySql has its own
> time and PHP its own time (most of the time!)....
>
> Thanks,
> Mag
>
> =====
> ------
> - The faulty interface lies between the chair and the keyboard.
> - Creativity is great, but plagiarism is faster!
> - Smile, everyone loves a moron. :-)
>
>
>
> _______________________________
> Do you Yahoo!?
> Declare Yourself - Register online to vote today!
> http://vote.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>