Re: [PHP] Getting days after last login. Date problem

2002-02-13 Thread Matt Moreton

You can convert both date formats into a UNIX timestamp, then do a
picturedate > logindate.

To convert them into a unix timestamp you need to use strtotime function

http://www.php.net/manual/en/function.strtotime.php

$ldate = strtotime($logindate);
$pdate = strtotime($picturedate);

if ( $pdate > $ldate ) {
// do some funky stuff
}

Hope that helps.

Regards

Matt.

- Original Message -
From: "Andy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 13, 2002 11:19 AM
Subject: [PHP] Getting days after last login. Date problem


> Hi there,
>
> I would like to find out the changes on content after a members last
login.
>
> The format of the date stored in the member db is e.g.:   Feb 13, 2002
> The format of e.g pictures uploaded is:
> 2000-02-13
>
> How can I search for pictures which are uploaded since the members last
> login. Is ist possible to convert the memberdate format to the other one
and
> just search for something like picturedate > logindate?
>
> Thanx for any help
>
> Andy
>
>
>
> --
> 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




Re: [PHP] Getting days after last login. Date problem

2002-02-13 Thread Girish Nath

Hi

You may be able to convert the member db date to a unix timestamp using
strtotime()

http://www.php.net/manual/en/function.strtotime.php

Then use one of the other functions at :

http://www.php.net/manual/en/ref.datetime.php

to convert the pictures db date also to unix timestamp, then compare the two
dates as you suggested.


Girish
--
www.girishnath.co.uk



- Original Message -
From: "Andy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 13, 2002 11:19 AM
Subject: [PHP] Getting days after last login. Date problem


Hi there,

I would like to find out the changes on content after a members last login.

The format of the date stored in the member db is e.g.:   Feb 13, 2002
The format of e.g pictures uploaded is:
2000-02-13

How can I search for pictures which are uploaded since the members last
login. Is ist possible to convert the memberdate format to the other one and
just search for something like picturedate > logindate?

Thanx for any help

Andy



--
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