Displaying a MS Access - Medium time field
| From: | Asendorf, John | Date: | Tue, 05 Mar 2002 18:38:45 +0000 |
| Subject: | Displaying a MS Access - Medium time field | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-12473@lists.php.net to get a copy of this message | ||
I have a MS Access 2000 database, which has a field whose format is "Medium
Time" named $class_time.
The $class_date (Format "Short Date") prints with no problem.
If I try to take the field from the database (without formatting) and echo
it, I get "1899-12-30 13:00:00"
If I try: date ("format", strtotime($class_time)) with the $class_time field
I get an unexpected error (probably because the date (as you can see above)
is prior to Dec 13, 1901).
If I try: date ("format", $class_time) I get 7:31 PM for every entry.
Any solutions? This isn't my database, so I'd prefer not to screw with it
too much if I can help it. CODE FOLLOWS:
$class_date = $schedule->fields[0];
$class_date = date ("l, F j, Y", strtotime ($class_date));
$class_time = $schedule->fields[1];
$class_time = date ("g:i A", $class_time ); //<--I have tried this with
strtotime also to no avail
echo "<td>$class_date<br />$class_time</td>\n"; //echoes date
wonderfully,
time all messed up
---------------------
John Asendorf - jasendorf@lcounty.com
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Nullum magnum ingenium sine mixtura dementiae fuit