Current location: Hot Scripts Forums » Other Discussions » Database » mysql- convert Date format


mysql- convert Date format

Reply
  #1 (permalink)  
Old 04-25-11, 07:48 AM
triplebig triplebig is offline
Newbie Coder
 
Join Date: Nov 2007
Posts: 83
Thanks: 6
Thanked 0 Times in 0 Posts
mysql- convert Date format

i have a list of date in text i want to convert to mysql


the date now is in dd.mm.yy format ( eg 01.01.88 )

i want to change it to date format yyyy-mm-dd : 01-01-1988

How do i do that ? i want to insert the text date to mysql table but in yyyy-mm-dd from dd.mm.yy
Reply With Quote
  #2 (permalink)  
Old 04-28-11, 02:37 AM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
PHP Code:

$d "01.01.88";
$dateParts explode(".",$d);
$mysqlDate date("Y-m-d"mktime(000$dateParts[1], $dateParts[0], $dateParts[2]));
echo 
$mysqlDate
__________________
Jerry Broughton
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] convert string into an mysql compatibel datetime format Confidence PHP 5 04-26-09 05:40 AM
[SOLVED] Convert combo selectd value into date format chavdanimesh Windows .NET Programming 1 05-30-08 09:22 AM
date format mysql and php Deansatch PHP 9 03-28-08 04:06 AM
converting date-string to Date object UnrealEd Everything Java 4 05-15-07 06:20 PM
Convert into datetime MySQL format. Oskare100 Database 2 01-23-07 11:23 AM


All times are GMT -5. The time now is 05:16 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.