MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 11th, 2005, 10:01 AM
il_duce il_duce is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 5 il_duce User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 31 sec
Reputation Power: 0
quick idea on how to change to Date format for 1500+ records

Hi,

like I said in my previous post I've inherited a horrendously designed database.

3 of the tables have dates stored as VarChar format like so:
05 January 2005

I want to convert these to Date format.

All 1692 of them!! he he he

Anyone know of a quick way or shall I code a function to do it Php?

Reply With Quote
  #2  
Old February 25th, 2005, 05:06 PM
Surround82 Surround82 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 1 Surround82 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 21 sec
Reputation Power: 0
I'm working on the same thing, but for 20,000+ records.
Easiest way: strtotime() function of php.
Example:

<?php
$input = "26 January 2004";
$time = strtotime($input);
$output = date("Y-m-d", $time);
echo $output;
?>

The output will be "2004-01-26" which is mysql compliant.

Good luck

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > quick idea on how to change to Date format for 1500+ records


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway