Does anyone could help me how to convert data from email header?
I have the next date format from email header:
Wed, 28 Apr 2010 21:59:49 -0400
I need to convert them into mysql Date, or timestamp. Thanks!
Does anyone could help me how to convert data from email header?
I have the next date format from email header:
Wed, 28 Apr 2010 21:59:49 -0400
I need to convert them into mysql Date, or timestamp. Thanks!
You should be using
DateTime
for this, specificallyDateTime::createFromFormat()
:Now, you have a Date object in
$date
, and you can grab the unix timestamp (if that's what you want), or you can format it into a date for MySQL.You can see it working in the demo.