Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

convert VARCHAR to TIMESTAMP?

westmatrix's profile image westmatrix posted 13 years ago in General Permalink
date = VARCHAR (30) current format 3 October 2008
How would I convert a VARCHAR to a TIMESTAMP along with the data.

Cheers
rosenfield's profile image rosenfield posted 13 years ago Permalink
select
unix_timestamp(
str_to_date(
'3 October 2008',
'%e %M %Y'
)
) as mytimestamp
;
westmatrix's profile image westmatrix posted 13 years ago Permalink
Wow that's neat, except it only works with the text entered and not the actual database field.
I asked without thinking.
table;
ID; DATE; NAME; PHOTO
data;
1, 3 October 2008, blah blah blah, Y

Please login to leave a reply, or register at first.




Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.