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

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Wed Mar 15 23:00:05 CET 2006


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
> 
> import locale
> import datetime
> 
> locale.setlocale(locale.LC_ALL, '')
> ...
> dt = datetime.date.today()
> print dt.strftime('%x')
> 
> This works well in other scripts or at the interactive prompt. It
> doesn't work in a cgi script: in the browser the date is shown as
> 'mm/dd/yyyy' which is _not_ my 'Locale's appropriate date
> representation' as the documentation for strftime calls it.

That's the web server's locale appropriate date representation then.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list