DateTime stored as ten-digited long string in MySQL table field

Team,

I see that certain tables in MySQL db have fields like activity_started/activity_ended etc., having values stored as ten-digited long strings (ex: 1589830722). May I know how to convert it back to the usual yyyy-mm-dd format using a PHP function/approach, after querying it from db?

FYI, I tried to convert it into DateTime instance but in vain.

Thanks in advance.

  • This topic was modified 6 days, 7 hours ago by abdulraafay.



Source link