The best way to parse dates from email
What I am doing in my mail client is retrieving all tokens marked with spaces and then iterating over them with heuristics to decide how to classify each token. For example, if a token has a ":" character in it, then I consider it as a time that should be parsed as ##: ##: ##. If he has. or "-" treats it as a day / month / year combination and you have to decide which one ... can be any number of combinations. If the token starts with a letter (i.e. Isalpha (* string)), you are looking for the name of the month. If it's a number, it could be a day or a year ... decide by length and if you have a pre-existing day or year, etc. If the token starts with "-" or "+" then it is the timezone, parse accordingly.
It seems to work in the field pretty well, my email client has been around for about 10 years or so. My code is C ++, but you can write the same thing in PHP easily, it is not particularly language specific.
a source to share
if you mean the date it was sent (or received), you extract them from the message headers (for example, the "Date:" header) and they have a standard date format, see RFC 2822
Anyway, if you are using javamail (it is now open source) you can get the date sent with
Date sentDate = mail.getSentDate();
a source to share