OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

MySQL Date question

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> MySQL Date question
Page: [1]
 
sentinel

 

Posts: 570
Joined: 5/4/2005
From: Chicago, Illinois
Status: offline

 
MySQL Date question - 6/12/2009 11:18:06   
Hey all....

I am using mysqlimport to push a .csv file into a table. The table data looks like this.

6/11/09,1281104,324,313,11,0,96

The problem I have is after the import is completed the data is wrong in the table.

6/11/09 show up like this: 0006-11-09.

I understand that it is due to mysql default date setup as yyyy-mm-dd. Is there a way to change this on mysql for the datefield in question?

Thanks,

Rich

_____________________________

No matter where you go, there you are.
womble

 

Posts: 5972
Joined: 3/14/2005
From: Living on the edge
Status: offline

 
RE: MySQL Date question - 6/14/2009 10:13:22   
Check out the MySQL manual, which can be found in various places online, inlcuding here (the definitive source), for whichever version of MySQL your server's running. The manual's huge (but it is divided up into sections), and there's a section on data formats - IIRC it's chapter 10 on the different data types, and there's a section on formatting dates and times.

It's a while since I've done anything with MySQL involving dates so I can't remember offhand exactly how it's done with the specifiers (of which there are loads, but they're all listed in the MySQL manual), but you should be able to use "DATE_FORMAT()" to format the date how you want it. Your year in the data's best in the four letter format though because MySQL will interpret two-digit ambiguous dates assuming that 00 to 69 is in this century (i.e. the 21th century, so it'd interpret 14/06/09 as 14/06/2009, but 70 to 99 as being in the 20th century - so it'd interpret 14/06/71 as 14/06/1971, which might be fine now using a two-digit year, but could cause problems further down the line.

< Message edited by womble -- 6/14/2009 10:27:07 >


_____________________________

~~ "A cruel god ain't no god at all" ~~
~~ Erase hate. Practice love. ~~

(in reply to sentinel)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> MySQL Date question
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts