Page is a not externally linkable
- Code, Content, and Presentation
-- Databases
---- CSV into MySQL for Dates - formatting


g1smd - 11:57 pm on Dec 4, 2011 (gmt 0)


You'll need YYYY-MM-DD format.

If your text editor has RegEx edit capability then you could easily reformat the data.

Replace * with whatever is immediately before and after the date: comma, quote, space, whatever.

First pass:
*([0-9][0-9])/([0-9][0-9])/([0-9][0-9][0-9][0-9])* => *\3-\1-\2*

Second pass:
*([0-9])/([0-9][0-9])/([0-9][0-9][0-9][0-9])* => *\3-0\1-\2*

[edited by: g1smd at 12:03 am (utc) on Dec 5, 2011]


Thread source:: http://www.webmasterworld.com/databases_sql_mysql/4394199.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com