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
  • 330,695
  • 80
  • 606
  • 657
TobSta
  • 716
  • 1
  • 9
  • 28

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
  • 32,277
  • 10
  • 49
  • 61