Re: DATE
| From: | Andy Hoffman | Date: | Tue, 12 Sep 2000 13:25:49 +0000 |
| Subject: | Re: DATE | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-2595@lists.php.net to get a copy of this message | ||
Zenton wrote:
> I am usoing this script below to log visitors to a mySQL database on a
> Zeus webserver.
>
> The log files are all fine except for the date field that reads 00:00:00
> etc etc.. is this a timestamp issue? Anyone know how I can get around
> this prob?
Karl,
This is probably an issue with MySQL, and not a bug... I'm betting that you
have that particular field in your table defined as a DATE in MySQL. Well,
the MySQL DATE type only stores a date, and not a date & time. Thus, if you
read in a date field and then try to set it to a datetime or timestamp value
in PHP, you'll get a time of 00:00:00. Perhaps what you want (if you care
about the time information) is use either the DATETIME or TIMESTAMP data
types for that field in MySQL. If not, just ignore the time value, as it's
still a relevant date (12am on the date in question).
--
Andy Hoffman
Web Developer
Bristol-Myers Squibb
email: andy.hoffman@bms.com