Skip to content

Instantly share code, notes, and snippets.

@knzm
Created February 23, 2012 06:18
Show Gist options
  • Save knzm/1891045 to your computer and use it in GitHub Desktop.
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
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