Created
February 23, 2012 06:18
-
-
Save knzm/1891045 to your computer and use it in GitHub Desktop.
One-liner to extract Date field from a mail and convert it into ISO 8601 format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
formail -c -x Date | python -c 'import sys, datetime; from rfc822 import parsedate; print datetime.datetime(*parsedate(sys.stdin.readline())[:6])' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment