Re: Yes, a newbie and a date question
| From: | Jason Wong | Date: | Fri, 16 May 2003 18:04:15 +0000 |
| Subject: | Re: Yes, a newbie and a date question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147947@lists.php.net to get a copy of this message | ||
On Saturday 17 May 2003 01:39, Shrader, Patrick wrote:
> Greetings, list! I am new to PHP and MySQL, though not to programming (big
> iron machines). I have been stumbling for a while now on a date problem. I
> have a MySQL database setup where I need to display a shipdate to the user.
> I need the date and the day of week in separate fields.
>
> I want to convert the MySQL timestamp field to 5/15/2003 and "Friday".
>
> My date value is stored as a MySQL timestamp value, length 14.
MySQL timestamp != Unix timestamp
If you want to use your existing code then change your SELECT statement to use
UNIX_TIMESTAMP() on your date field.
Another approach would be to format the date and extract the day of week
directly from MySQL.
Refer to the MySQL manual for more info on Date/Time functions.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The all-softening overpowering knell,
The tocsin of the soul, -- the dinner bell.
-- Lord Byron
*/