[python-users] strftime und Wochennummer im ISO Format

Stefan Pampel stefan.pampel at polyformal.de
Sa Nov 22 17:44:34 CET 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Christopher Arndt schrieb am 22.11.2008 14:43:
> In der Dokumentation des time Moduls sind nur die Formatcodes "%U" und
> "%W" genannt, die beide nicht das sind, was du brauchst. Wenn du aber
> "man 3 strftime" aufrufst (die entspr. Manpages müssen natürlich
> installiert sein), siehst du, welche zusätzlichen Formatcodes deine
> C-Library unterstützt.
> 
> Auf dem Mac OS X 10.4 an dem ich gerade sitze, gibt es z.B. den
> Formatcode %V:
> 
>>>> import locale
>>>> import time
>>>> locale.setlocale(locale.LC_ALL, 'de_DE')
>>>> time.strftime('%x KW %V')
> '22.11.2008 KW 47'

Gesagt getan, %V tut es nun.

Danke

Stefan

- --
/ polyformal                  /
| Kaesenstraße 8             /
| 50677 Köln - Germany      /
| phone: +49 221 3103 122
| fax:   +49 221 9311 9223
| http://www.polyformal.de/
|______________________/

GPG KEY: 11678845
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkkoNvIACgkQXXT1nfS2Z+FBAgCfWjAclPZM0SlR9IJSM5c++ijy
9M0AnAxZtO5ZU05/UtWwstcY2HYMZKbE
=RRVt
-----END PGP SIGNATURE-----



Mehr Informationen über die Mailingliste python-users