Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Christopher Arndt Newsgroups: de.comp.lang.python Subject: Re: [Python-de] Datum aus Mails parsen Date: Tue, 22 Mar 2016 23:44:18 +0100 Lines: 70 Message-ID: References: <2799516.e1sbLbDSJX@horus> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DbR3NgqLgtVffBVLOvkubxRLloGgAeHIr" X-Trace: news.uni-berlin.de l5tp9c9u7W+sSfjxxri0KAV0Xy3qKLz/xd21e7voUURA== Return-Path: X-Original-To: python-de@python.org Delivered-To: python-de@mail.python.org X-Virus-Scanned: Debian amavisd-new at mx1.0x20.eu Openpgp: id=F0BA1EAE86651989C0A1C9901E0D97B33A4E1F31 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 In-Reply-To: <2799516.e1sbLbDSJX@horus> X-BeenThere: python-de@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Die Deutsche Python Mailingliste List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com de.comp.lang.python:4321 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DbR3NgqLgtVffBVLOvkubxRLloGgAeHIr Content-Type: multipart/mixed; boundary="upSwtsjNpNwXEjkNUcNwWhwe002trflau" From: Christopher Arndt To: Die Deutsche Python Mailingliste Message-ID: <56F1CAC2.7010904@chrisarndt.de> Subject: Re: [Python-de] Datum aus Mails parsen References: <2799516.e1sbLbDSJX@horus> In-Reply-To: <2799516.e1sbLbDSJX@horus> --upSwtsjNpNwXEjkNUcNwWhwe002trflau Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Am 22.03.2016 um 20:59 schrieb Florian Lindner: > ich will das Datum einer Mail rausfinden, ob es das Sende- oder Empfang= sdatum=20 > ist, oder eins der Stationen in der Mitte ist egal. > > Nun frage ich mich, was da am zuverl=E4ssigsten ist? Du musst wissen, ob dir das Datum nah an der Quelle oder am Emp=E4nger wichtiger ist. Such dir eins aus: import email from dateutil.parser import parse # [1] with open('mail.eml') as fp: mail =3D email.message_from_file(fp) dates =3D [parse(recv.split(';')[1]) for recv in mail.get_all('Received')] Chris [1] https://pypi.python.org/pypi/python-dateutil/ --upSwtsjNpNwXEjkNUcNwWhwe002trflau-- --DbR3NgqLgtVffBVLOvkubxRLloGgAeHIr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Puzzled by the all these strange characters? Comment: See http://tinyurl.com/cehoa7 for an introduction Comment: to public key encryption and signing. iQIcBAEBCAAGBQJW8crCAAoJEB4Nl7M6Th8xVCMQAIrxHUDXPSLjNoASbDblQEG9 4s/iU39OdQcCqyDq2sRo1SA44M1lE8TtDedhWXgUL3Xq9jRZPlCNvJAUYA3OErYy d6uM7J5vN4qxDxBUSdvT1P7vstFkaHrJrIfOkg1d3g3lNGfmkPSicsssu2S+Ynwr PpqAEum8fDd79pa7qDBYNj3s8srKjeiH2bEoNUAIQ/q8lZsPZf97o9lKSoSZFktZ XHaFBUZBBOYhJ9uSfCAs2vwXjG8qKvxJyC+NfkqoNDo6QFrqX/pNM4Jck2EvYb2r f0d6IUAaMtl5II3Am6whP/lXG/mxJc/VZmC7Gte1CrpiUkGhl+pMgmQywMnlddlP P66ef8LGzKyeMI0CVjpzwJd8jh1t5BSg63Pg/UDtW1iNcxsTUzOpyU+qdtuFE6KP mdxFLFcHlXTPWToPAxsJpZKlskxna436km6cSfXBuTupGy7tG/R8wxJCxNW4noj/ kuDTgKBEbOXKdQPe5IbJFazI5HZ4I/BnN7eTp1ESdwka5d85umIWhbj9tFwTJkyG 06YXJF0JM+L0JBzQP93sp+FzB+cppYl9oVQzyTepZyjrbMBVOHoKWtLcd/sw69wb Q5b2YBSolu2lhiQQSIcq59fpaXueFiHxert+VqYpLaK0uoU4956cbOnDsUtzFNfi q0pYuH2s316gLh434sIg =6eoX -----END PGP SIGNATURE----- --DbR3NgqLgtVffBVLOvkubxRLloGgAeHIr--