Date formats

Max M maxm at mxm.dk
Fri Jun 14 10:40:11 CEST 2002


Duncan Booth wrote:

> The documentation says that on some platforms an optional field width and 
> precision specification can follow the initial '%'. This is obviously 
> highly non-portable, but might provide a suitable solution if you are not 
> desperate for portability. For example, if you are running under Windows 
> using "%#d-%#M-%Y" as the format string gives the format you require.


Oh ... I cannot seem to find it in the docs. The closest I come is in:

2.2.6.2 String Formatting Operations

where it says that:

"# The value conversion will use the ``alternate form'' (where defined 
below)."

So I guess that single digit is the "alternate form" here.

Well anyhoo it solves my problem as it' will only run on a windows 
server, and even if it's ever moved to another platform my code has no 
trouble reding the two digit form, so I guess I will settle for that.

thanks Max M




More information about the Python-list mailing list