CodeIgniter Forums
Email timestamp to unix timestamp - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: Email timestamp to unix timestamp (/thread-72084.html)



Email timestamp to unix timestamp - neuron - 11-02-2018

Hi, 
I do some processing in email box. 
I need to convert timestamp in email header to unix timestamp.
I don't know which format uses email for time formatting.
example email date format is:
Tue, 30 Oct 2018 07:00:08 +0000

I googled but could not find solution. 

Thank you in advance.


RE: Email timestamp to unix timestamp - dave friend - 11-02-2018

PHP Code:
$dt = new DateTime("Tue, 30 Oct 2018 07:00:08 +0000");
echo 
$dt->getTimestamp(); 

outputs 1540882808

PHP DateTime docs


RE: Email timestamp to unix timestamp - neuron - 11-05-2018

thank you very much, I did know that solution is so simple Smile