[wxPython-users] wx.grid.GridCellDateTimeRenderer

Mark Erbaugh mark at microenh.com
Mon Feb 4 12:13:26 PST 2008


On Mon, 2008-02-04 at 10:48 -0800, Robin Dunn wrote:
> Mark Erbaugh wrote:
> > Is there any documentation on the informat and outformat parameters to
> > the constructor for a GridCellDateTimeRenderer?  The default is
> > wx.DefaultDateTimeFormat which appears to be '%c'.  
> 
> It should be similar to (or the same as) the format used by the C 
> strftime function.  Since Python's time.strftime is also based on the 
> same format strings you can use that doc as a guide too.

Robin,

Thanks for the reply.  It looks a little more involved. As near as I've
been able to determine through experimentation, the informat parameter
needs to be set.  The data I'm displaying is a Python datetime instance.
Unless I specify informat='%Y-%m-%d', the date is displayed as
'YYYY-MM-DD' regardless of the outformat value. When I correctly specify
the informat value, the outformat value controls the display.

Since datetime.print() yields YYYY-MM-DD xxx, I assume that a print()
conversion is being made converting the datetime to a string and then
the informat conversion is applied to parse that string. Finally, the
outformat conversion is applied to get the display value.

Mark





More information about the wxpython-users mailing list