Go Back   DaemonForums > Miscellaneous > Programming

Programming C, bash, Python, Perl, PHP, Java, you name it.

Thread Tools Display Modes
  #1   (View Single Post)  
Old 21st June 2009
cksraj cksraj is offline
Real Name: Crew Kasy Raj
Port Guard
Join Date: Mar 2009
Posts: 12
Question Convert varchar () to datetime datatype in MYSQL

Hi dudes

I have a varchar something like this 'Wed Jun 17 12:06:04 2009' I would like to store into my MySql database. How to convert this varchar to datetime datatyep? Just guide me...

Reply With Quote
  #2   (View Single Post)  
Old 22nd June 2009
anemos's Avatar
anemos anemos is offline
Fdisk Soldier
Join Date: May 2008
Location: Ελλάδα
Posts: 53

mysql> SELECT STR_TO_DATE('Wed Jun 17 12:06:00 2009', '%W %M %d %T %Y');
| STR_TO_DATE('Wed Jun 17 12:06:00 2009', '%W %M %d %T %Y') |
| 2009-06-17 12:06:00                                       |
1 row in set (0.00 sec)


Last edited by anemos; 22nd June 2009 at 01:01 PM.
Reply With Quote

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Want to convert my server to raid revzalot OpenBSD Installation and Upgrading 2 16th September 2009 07:56 PM
MySql on NetBSD 5.0 Zvrk NetBSD General 6 17th August 2009 12:31 PM
MYSQL 's fault? disappearedng FreeBSD General 3 14th October 2008 11:53 PM
mysql using >100% cpu bdj FreeBSD General 5 16th May 2008 04:20 PM

All times are GMT. The time now is 05:05 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick