[thelist] Long Date to Datetime Conversion

Howard Cheng howcheng at ix.netcom.com
Wed Dec 4 17:45:00 CST 2002


If you're using PHP, you should know about the wonders of the strtotime()
function.

http://www.php.net/manual/en/function.strtotime.php

.NET also has a nice way to convert strings to date values, via the
DateTime.Parse() method, but it's not as neat as strtotime().

At 03:21 PM 12/4/2002 -0500, Alan McCoy wrote:
>I have a sql dump file of a bunch of news articles that I need to import
>into a MySQL database. However, the dates on all the records is in long
>format (like "October 13, 1998") and the database field that the dates
>will be entered into is in datetime format. Normally, I would change the
>date column to varchar, but there's already a BUNCH of records already
>there.
>
>Is there a painless method of converting the date format so that
>"October 13, 1998" would become "1998-11-13" ?

::::::::::::::::::::::::::::::::::
Howard Cheng
http://www.howcheng.com/
howcheng at ix dot netcom dot com
AIM: bennyphoebe
ICQ: 47319315




More information about the thelist mailing list