Click here to get back home

Date format

 HomeNewsGroups | Search | About
 mailing.database.mysql    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Date format Rotsj 02-01-2006
Get Chitika Premium
Posted by Rotsj on February 1, 2006, 4:16 pm
Please log in for more thread options
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.



Posted by Aggro on February 1, 2006, 5:21 pm
Please log in for more thread options
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.html

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-functions.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

Similar ThreadsPosted
Date Format November 2, 2005, 7:17 pm
Date format August 18, 2008, 4:11 pm
How to specify Date format during LOAD DATA INFILE ? June 27, 2005, 6:52 pm
Converting VARCHAR "date" info to an actual date field August 15, 2005, 7:49 pm
convert field data to another format April 12, 2006, 5:16 pm
Urgent : DateTime format in MySQL September 11, 2006, 12:12 am
Returned mail: Data format error February 11, 2007, 3:43 am
RETURNED MAIL: DATA FORMAT ERROR March 7, 2007, 4:40 am
Excel -> MySQL ODBC data format problem February 9, 2006, 12:08 pm
help to retieve only the difference in minutes between two dates in DATETIME format December 18, 2006, 8:31 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap