convert unix timestamp to regular date time

Hi all,

What would be the best way to convert a unix timestamp column in a mysql db to a regular date and time?

im new to sql so any help, links would be great
elektroshockAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mohed SharfiVice CEOCommented:
Hi elektroshock,
Please try this: SELECT unix_timestamp(now())
thanks
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mohed SharfiVice CEOCommented:
Hi elektroshock,
how are you,that example to convert a normal datetime to unix timestamp
this sample code to convert a unix timestamp  to a regular date and time
thanks

mysql> SELECT FROM_UNIXTIME(1111885200);
 
-- Result: 2005-03-27 03:00:00       

Open in new window

0
elektroshockAuthor Commented:
thats great thank you :)

any idea on how to transform an entire column that has been moved to a new db?

the column contains all unix timestamp data but the column is now varchar

thanks again
0
Mohed SharfiVice CEOCommented:
Hi elektroshock,
are you fine?
regarding to transform col. into new DB My idea is keep your col. type in timestamp or datetime to get validation layer from DB.
thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.