Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: "Andreas Jung" Newsgroups: de.comp.lang.python Subject: Re: [Python-de] Datetime frage Date: Sun, 11 Dec 2016 19:39:55 +0100 Lines: 91 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=_MailMate_787A53D8-0082-4341-ABB7-226D572D4333_="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Trace: news.uni-berlin.de DpbuJUsmngP4aB/pEnuLOg1/Tv5rJufkiQ/nKKMQd4MQ== Return-Path: X-Original-To: python-de@python.org Delivered-To: python-de@mail.python.org In-Reply-To: X-Mailer: MailMate (1.9.6r5310) X-Df-Sender: aW5mb0B6b3B5eC5uZXQ= X-BeenThere: python-de@python.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Die Deutsche Python Mailingliste List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: Xref: csiph.com de.comp.lang.python:4595 This is an OpenPGP/MIME signed message (RFC 3156 and 4880). --=_MailMate_787A53D8-0082-4341-ABB7-226D572D4333_= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable import datetime as dt import locale locale.setlocale(locale.LC_ALL, 'de_DE') heute =3D dt.date.today() print("Heute ist =3D ",heute) print(heute.strftime("%A %d. %B %Y")) # Tag und Monat ist in English print(locale.getlocale()) -aj On 11 Dec 2016, at 19:33, Manfred Gil wrote: > Hallo Liste, > > ich spiele gerade mit Datetime rum, um das Modul verstehen zu k=C3=B6nn= en. > Dabei viel mir auf das ich nur die Englische Bezeichnung bekomme. > > > > import datetime as dt > > heute =3D dt.date.today() > > print("Heute ist =3D ",heute) > > print(heute.strftime("%A %d. %B %Y")) # Tag und Monat ist in English > > import locale > > print(locale.getlocale()) > > > > Die Ausgabe bei mir lautet: > > Heute ist =3D 2016-12-11 > Sunday 11. December 2016 > ('de_DE', 'UTF-8') > > > Frage: > Wie bringe ich datetime bei, die Ausgabe in Deutsch zu schreiben, ich d= achte ( so hab ich es > verstanden ) das, wenn locale richtig gesetz ist, die Ausgabe auf Deuts= ch erscheinen sollte. > > Mein lese link: > https://docs.python.org/3.4/library/datetime.html?highlight=3Ddatetime#= strftime-and-strptime-behavior > > Gru=C3=9F und Danke f=C3=BCr weitere Infos > > Manfred > > > > -- = > Wie man sein Kind nicht nennen sollte: > Lutz Ern > _______________________________________________ > python-de maillist - python-de@python.org > https://mail.python.org/mailman/listinfo/python-de --=_MailMate_787A53D8-0082-4341-ABB7-226D572D4333_= Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQGUBAEBCgAGBQJYTZ17AAoJEADcfz7u4AZjrFALwKtfRazP7VOSBK7+sPPfIYZk VDfjg4qk31PVFgtZT4sY818T3zIBQlb+jrLH62fIUaHUTexfYCGB8NcCrm2cU5/X eNBEYlbVN5C7xzz06H4k5IfNgidxbjwPvcM/6+ZMimMVhcFvP6O2Mbbx0vryhCzr bs+gLTb9oJtpwtlgY+g5S/VshvL0PbZ3p7eD4O7MYsqC580ljDczfqvPJHPELfja WY03y/WKSqoaqZ3x0hhn3BZGVzE8Bvw5704JOmGnqQqp4EpKiwzct9DFkuxuIWD4 eHhBJTqoqXTYyKNpnicmXOGkpo+5Xvl1xeH0WXcBBHGdAu9GkyMi1hoz1POXhhD8 W7PqiO7eIyep2Aeb6eu6+NuoewmfDMgoKovpI6urJD343yLCbVzQdMCmd4AGYO/m ihGxKho1VA6fHHr+FgoO50K7kSkgEFB+pcBWivG0s5vFw+61dIp8Vg0nhNnbhCAz ZA0n9kgZm77XFDmpHc780K2xnFzk2Ls= =7vPI -----END PGP SIGNATURE----- --=_MailMate_787A53D8-0082-4341-ABB7-226D572D4333_=--