Date format
am 01.02.2006 22:16:13 von r.knipscheer
Hi,
i'm using visual foxpro 9 with a mysql 5 database, for direct access to my
database i use navicat. In visual foxpro i've set my date format to
dd-mm-yyyy, also i did this in navicat.
However when i insert a date into my database i have to insert it with the
format yyyy-mm-dd. Is this a setting in mysql or is there another reason?
Thanks.
Rotsj.
Re: Date format
am 01.02.2006 23:21:52 von Aggro
Rotsj wrote:
> Hi,
> i'm using visual foxpro 9 with a mysql 5 database, for direct access to my
> database i use navicat. In visual foxpro i've set my date format to
> dd-mm-yyyy, also i did this in navicat.
> However when i insert a date into my database i have to insert it with the
> format yyyy-mm-dd. Is this a setting in mysql or is there another reason?
"Although MySQL tries to interpret values in several formats, dates
always must be given in year-month-day order (for example, '98-09-04'),
rather than in the month-day-year or day-month-year orders commonly used
elsewhere (for example, '09-04-98', '04-09-98')."
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-types.h tml
Depending on what version you are using, there are less or more easy
methods to convert date from one format to another. See these functions
for starters:
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functio ns.html
The reason for saving dates in IS0 8601 format is that there is not that
many ways to tell does for example "01.12.2005" mean 2005-12-01 or is it
2005-01-12. As in some countries people prefer day.month.year format and
in the others month.day.year is preferred. So by using the ISO 8601 you
will always know what the date means, no matter who and from where wrote it.
http://www.w3.org/QA/Tips/iso-date