Hello...
I created a table with MS ACCESS2000.
THis table contains a date/time field with the format dd.mm.yyyy.
When I connect to the databse with PHP and load this field/column, I get the date displayed in "yyyy-mm-dd hh:mm:ss"...
How do I fix this???
Greets,
Jochen
Access2000 + PHP4 date format
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Ok, now you've actually stated your question. I could tell you how to do this in MySQL since that's nice and easy but I have no idea if Access 2000 does things in the same way - try looking in the help text for DATE_FORMAT.
But since you're using MS Access (you should consider changing you know
) and having actually looked at the date and time functions in PHP (and edited away my former very hacky solution):
Mac
But since you're using MS Access (you should consider changing you know
Code: Select all
<?php
$date_from_database = '2002-01-03';
$db_date = strtotime($date_from_database);
$db_date = date('d.m.y', $db_date);
echo $db_date;
?>
Last edited by twigletmac on Wed Aug 28, 2002 2:23 am, edited 1 time in total.
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
This might help: http://www.php.net/manual/en/function.strtotime.php