Re: Getting days after last login. Date problem
| From: | Adam Royle | Date: | Wed, 13 Feb 2002 13:06:55 +0000 |
| Subject: | Re: Getting days after last login. Date problem | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-16899@lists.php.net to get a copy of this message | ||
Hey there...
Sometimes it is easier to store the date as a unix timestamp (seconds since midnight 1/1/1970) cause it allows you to format the date any way you want, and php has cool date and time functions which rely on a timestamp.
A time stamp example is like this:
<?php
$timestamp = time();
echo "Timestamp: " . $timestamp . "<br>Formatted date: " . date("j/m/Y",$time);
?>
would produce something like:
Timestamp: 1013605509
Formatted date: 13/02/2002
and then you can store the value of $timestamp in a database and calculate the formatted string later...
Adam
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