Forum Moderators: coopster
20040228150703
I can read that and see the year, month, day, HH, MM, SS.
My script doesn't return what I see. The db field is called timefield, and is being returned to my qry with everything else. In other words, SELECT *. Then I'm trying to parse out the various pieces.
$ddd = date(DAY,$line['timefield']);
$dwk = date(WEEK,$line['timefield']);
$dmo = date(MONTH,$line['timefield']);
$dyr = date(YEAR,$line['timefield']);
My results from these expressions are humorous at best:
$ddd = MonPM2038
$dwk = 3EEK
$dmo = Jan-0800NPST19
$dyr = 2038EPMR
Help?
Suggestion 1.
Don't extract then parse, parse as part of the query, using MySQL's built-in date and time functions [mysql.com] such as DATE_FORMAT.
Suggestion 2.
Use strtotime() to make a date, then use date(). This seems completely backwards to me, but you could make it work if you had some reason to avoid the mysql functions.
Tom