[Techtalk] Re: mysql date types

listjames at gmail.com listjames at gmail.com
Sat Aug 26 19:46:03 UTC 2006


On Sat, Aug 26, 2006 at 09:58:09PM +0930, rob_39 at bigpond.com wrote:
> Hi all
> 
> My mysql database only accepts dates in year month day format. The format in Australia is day month year.
> 
> I've found the date format server variable but setting that to day month year doesn't help.
> 
> This database will be used by new users and they wont understand the date constraints if I have to leave it at year month day.
> 
> I'm writing a php interface for using the database. Is there a way in php that I can change the date around from a day month year entered into a year month day for the database.
> 
> Thanks
> 
> Robyn

This is the code I use on pages in my web site to indicate the last date
when it was modified using the year, month, day format. This uses the php
date function.

<? echo "Last Modified: ", Date("Y-m-d", getLastMod()) ?>

This displays the date in numbers but php can display it several
different ways as shown on this page:
http://us2.php.net/manual/en/function.date.php

James


More information about the Techtalk mailing list