1

I have an unsigned int that I convert to datetime using:

pd.to_datetime(date_and_time,unit="s",origin='1906-05-01') 

How can i convert this using MySQL? I tried from_unixtime(date_and_time), but it just returns NULL

cs95
  • 379,657
  • 97
  • 704
  • 746
TobSta
  • 766
  • 2
  • 10
  • 29

1 Answers1

1

This is not a standard unix timestamp, since you set the starting point to '1906-05-01'. Basically, what you need is '1906-05-01' + 2626070399 seconds.

You can achieve this with the following mysql query:

select date_add('1906-05-01',interval 2626070399 second)

Or

select '1906-05-01' + interval 2626070399 second
Shadow
  • 33,525
  • 10
  • 51
  • 64