Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.python > #4595
| Path | csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | "Andreas Jung" <lists@zopyx.com> |
| Newsgroups | de.comp.lang.python |
| Subject | Re: [Python-de] Datetime frage |
| Date | Sun, 11 Dec 2016 19:39:55 +0100 |
| Lines | 91 |
| 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> |
| 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 | <lists@zopyx.com> |
| X-Original-To | python-de@python.org |
| Delivered-To | python-de@mail.python.org |
| In-Reply-To | <o2k666$fir$1@tota-refugium.de> |
| 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 <python-de.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-de>, <mailto:python-de-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-de/> |
| List-Post | <mailto:python-de@python.org> |
| List-Help | <mailto:python-de-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-de>, <mailto:python-de-request@python.org?subject=subscribe> |
| X-Mailman-Original-Message-ID | <D753C3B7-21FF-42C0-B27F-392E291E17E1@zopyx.com> |
| X-Mailman-Original-References | <o2k666$fir$1@tota-refugium.de> |
| Xref | csiph.com de.comp.lang.python:4595 |
Show key headers only | View raw
[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