On Wed, 2006-04-19 at 00:21 +1000, Ross Johnson wrote: > On Mon, 2006-04-17 at 15:10 -0400, Charles Sardeson wrote: > > I have an OOo Calc spreadsheet of ~60K rows in which there are at least > > a couple of dates in the MM/DD/YY format. I am able to convert them in > > the spreadsheet to YYYY-MM-DD, which is what I want to save into a CSV > > file to be loaded into a mySQL database. According to its own > > documentation, and I believe my own experience, mySQL gets twitchy if > > one tries to feed it a date in anything other than its preferred format. > > DB2 same same, so I suspect its typical of all relational DBMSs. > > > > I have experimented, Googled, and read the help in Calc, all fairly > > extensively, and I can't find anywhere (other than in my experience) > > that I can't save a spreadsheet date in YYYY-MM-DD format (an ISO > > standard, at that!) to a CSV file without having the pesky software > > switch it back to MM/DD/YYYY. > > I believe that Calc's CSV export filter formats dates according to your > locale setting (hence the US locale MM/DD/YYYY format), and this can't > be changed, except by changing locale. But I don't know of any locale > that would give you YYYY-MM-DD in CSV. >
MySQL's country of origin is Sweden and.setting this as language in cell styles works. Open the stylist(F11), right click the default cell style and select New. It should open a dialog with the Organize tab visible. Enter a suitable name(mysqldate) in place of "untitled". Switch to the Number tab and set Category = Date, Language = Swedish and Format = YYYY-MM-DD. Click OK to save the new cell style. Now select the cells with the dates that need formatting and double left click on the new mysqldate cell style. The selected cells should adopt the mysql format and retain it when exported to CSV. Barrie --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
