Skip to content
Advertisement

change the integer time to date format MM/DD/YY like datetime.fromtimestamp in python

I have a table as follow. In python with datetime.fromtimestamp we can change the integer time to date. I want to change the time column to MM/DD/YY in Mysql. Can you help me with that?

enter image description here

Advertisement

Answer


I forgot until the comment from nbk above that FROM_UNIXTIME() does support an optional second argument, so you can do this in one step:

Read about DATE_FORMAT() and FROM_UNIXTIME().

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement