Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.python > #4595
| From | "Andreas Jung" <lists@zopyx.com> |
|---|---|
| Newsgroups | de.comp.lang.python |
| Subject | Re: [Python-de] Datetime frage |
| Date | 2016-12-11 19:39 +0100 |
| Message-ID | <mailman.9.1481482819.2322.python-de@python.org> (permalink) |
| References | <o2k666$fir$1@tota-refugium.de> <D753C3B7-21FF-42C0-B27F-392E291E17E1@zopyx.com> |
[Multipart message — attachments visible in raw view] - view raw
import datetime as dt
import locale
locale.setlocale(locale.LC_ALL, 'de_DE')
heute = dt.date.today()
print("Heute ist = ",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önnen.
> Dabei viel mir auf das ich nur die Englische Bezeichnung bekomme.
>
> <Beispiel>
>
> import datetime as dt
>
> heute = dt.date.today()
>
> print("Heute ist = ",heute)
>
> print(heute.strftime("%A %d. %B %Y")) # Tag und Monat ist in English
>
> import locale
>
> print(locale.getlocale())
>
> </Beispiel >
>
> Die Ausgabe bei mir lautet:
>
> Heute ist = 2016-12-11
> Sunday 11. December 2016
> ('de_DE', 'UTF-8')
>
>
> Frage:
> Wie bringe ich datetime bei, die Ausgabe in Deutsch zu schreiben, ich dachte ( so hab ich es
> verstanden ) das, wenn locale richtig gesetz ist, die Ausgabe auf Deutsch erscheinen sollte.
>
> Mein lese link:
> https://docs.python.org/3.4/library/datetime.html?highlight=datetime#strftime-and-strptime-behavior
>
> Gruß und Danke für 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
Back to de.comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar
Datetime frage Manfred Gil <manfred-gil@t-online.de> - 2016-12-11 18:33 +0000
Re: [Python-de] Datetime frage "Andreas Jung" <lists@zopyx.com> - 2016-12-11 19:39 +0100
Re: [Python-de] Datetime frage Manfred Gil <manfred-gil@t-online.de> - 2016-12-11 19:20 +0000
Re: [Python-de] Datetime frage "Andreas Jung" <lists@zopyx.com> - 2016-12-11 20:29 +0100
Re: [Python-de] Datetime frage Hans-Georg Joepgen <test@joepgen.com> - 2016-12-11 20:49 +0100
Re: [Python-de] Datetime frage "Andreas Jung" <lists@zopyx.com> - 2016-12-11 20:56 +0100
Re: [Python-de] Datetime frage Christopher Arndt <chris@chrisarndt.de> - 2016-12-11 20:53 +0100
Re: [Python-de] Datetime frage Stefan Schwarzer <sschwarzer@sschwarzer.net> - 2016-12-11 21:03 +0100
Re: [Python-de] Datetime frage Manfred Gil <manfred-gil@t-online.de> - 2016-12-12 18:01 +0000
Re: [Python-de] Datetime frage Arnold Krille <arnold@arnoldarts.de> - 2016-12-12 21:04 +0100
Re: [Python-de] Datetime frage Achim Herwig <python@wodca.de> - 2016-12-11 21:03 +0100
Re: [Python-de] Datetime frage Manfred Gil <manfred-gil@t-online.de> - 2016-12-12 18:04 +0000
Re: [Python-de] Datetime frage Achim Herwig <python@wodca.de> - 2016-12-12 20:50 +0100
Re: [Python-de] Datetime frage Hans-Peter Jansen <hpj@urpla.net> - 2016-12-11 21:01 +0100
Re: [Python-de] Datetime frage Manfred Gil <manfred-gil@t-online.de> - 2016-12-12 18:07 +0000
Re: [Python-de] Datetime frage Hans-Peter Jansen <hpj@urpla.net> - 2016-12-12 21:42 +0100
Re: [Python-de] Datetime frage Manfred Gil <manfred-gil@t-online.de> - 2016-12-13 17:38 +0000
Re: [Python-de] Datetime frage Hans-Peter Jansen <hpj@urpla.net> - 2016-12-13 20:46 +0100
csiph-web