mydate.strftime('%x') and cgi script

Sibylle Koczian Sibylle.Koczian at Bibliothek.Uni-Augsburg.de
Mon Mar 20 09:48:28 EST 2006


Marc 'BlackJack' Rintsch schrieb:
> In <47lbrdFg58hmU1 at news.dfncis.de>, Sibylle Koczian wrote:
> 
> 
>>I'm writing a cgi script which only needs to run in a small LAN. I tried
>>to show dates in a reasonable format by using
>>
> 
> That's the web server's locale appropriate date representation then.
> 

The web server is on my machine - doesn't it use its regional settings?
I've seen a little more in the meantime:

xx = locale.setlocale(locale.LC_ALL, '')

# print HTML header, title, everything up to and including body tag

print xx

# print rest of page

In the cgi script xx is "C" and not "de_DE.utf-8". Looks as if setlocale
isn't executed.

If I do the same things using Windows instead of Linux, setlocale is
executed in the cgi script, no difference to the interactive interpreter.

Koczian

-- 
Dr. Sibylle Koczian
Universitaetsbibliothek, Abt. Naturwiss.
D-86135 Augsburg
e-mail : Sibylle.Koczian at Bibliothek.Uni-Augsburg.DE



More information about the Python-list mailing list