I am connecting to an API and its returning the date in UnixDate, not unix timestamp. How do I convert this format to be able to save it in a datetime field?
Example: 'Mon Jun 09 21:59:59 UTC 2025'
I am connecting to an API and its returning the date in UnixDate, not unix timestamp. How do I convert this format to be able to save it in a datetime field?
Example: 'Mon Jun 09 21:59:59 UTC 2025'
you can simply do
$date = date('Y-m-d H:i:s', strtotime('Mon Jun 09 21:59:59 UTC 2025'));
echo $date;