datetime arithmetics

hello,

I have to do datetime arithmetics in working days/timespans. I've seen wxDateTimeHolidayAuthority in wxwidgets manual but it doesn't seem to be included in wxpython. Will it be in the future? Can you suggest me other solutions or libraries that I could use?

thanks in advance, Marco

try using datetime module of python.

···

On Mon, 13 Sep 2004 00:44:00 +0200, m.prosperi@libero.it <m.prosperi@libero.it> wrote:

hello,

I have to do datetime arithmetics in working days/timespans. I've seen wxDateTimeHolidayAuthority in wxwidgets manual but it doesn't seem to be included in wxpython. Will it be in the future? Can you suggest me other solutions or libraries that I could use?

thanks in advance, Marco

--
Peter Damoc
Hacker Wannabe

And on top of that are...

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303441

and probably other solutions using datetime that Google will find for you.

ka

···

On Sep 13, 2004, at 2:57 AM, Peter Damoc wrote:

On Mon, 13 Sep 2004 00:44:00 +0200, m.prosperi@libero.it > <m.prosperi@libero.it> wrote:

hello,

I have to do datetime arithmetics in working days/timespans. I've seen wxDateTimeHolidayAuthority in wxwidgets manual but it doesn't seem to be included in wxpython. Will it be in the future? Can you suggest me other solutions or libraries that I could use?

thanks in advance, Marco

try using datetime module of python.

hello,

I have to do datetime arithmetics in working days/timespans.

wx.DateTime has some operators defined for it, but Python's datetime module is probably better and more intuitive.

For example:

>>> import wx
>>> bd = wx.DateTime()
>>> bd.Set(14, wx.DateTime.Aug, 1966)
<wx.DateTime: "Sun 14 Aug 1966 12:00:00 AM PST" at _40704108_p_wxDateTime>
>>> td = wx.DateTime.Today()
>>> td - bd
<wx.TimeSpan: "333839:00:00" at _40894c08_p_wxTimeSpan>
>>> ts = td - bd
>>> ts.GetDays()
13909
>>> ts.GetHours()
333839
>>> ts.GetWeeks()
1987
>>> td + wx.TimeSpan(5 * 24)
<wx.DateTime: "Sat 18 Sep 2004 12:00:00 AM PDT" at _707e3d08_p_wxDateTime>
>>>

I've seen wxDateTimeHolidayAuthority in wxwidgets manual but it doesn't seem to be included in wxpython.

It's an abstract class that doesn't have any concrete implementations yet.

···

m.prosperi@libero.it wrote:

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

wx.DateTime has some operators defined for it, but Python's datetime module is probably better and more intuitive.

In that case, perhaps it's time to take it out of wxPython? Wanna keep it mean and lean.

Bob

Bob Klimek <klimek@grc.nasa.gov> writes:

Robin Dunn wrote:

wx.DateTime has some operators defined for it, but Python's datetime
module is probably better and more intuitive.

In that case, perhaps it's time to take it out of wxPython? Wanna keep
it mean and lean.

Or make them wrappers to the proper functions, to preserve old code.

But, then there's one problem: which module to use? mx.DateTime (not a
standard module) or Python's datetime (not available in older Python
versions...)?

The wrappers could try Python's first and then mx's later...

···

--
Godoy. <godoy@ieee.org>

Bob Klimek wrote:

Robin Dunn wrote:

wx.DateTime has some operators defined for it, but Python's datetime module is probably better and more intuitive.

In that case, perhaps it's time to take it out of wxPython? Wanna keep it mean and lean.

To do that we would also have to take out wxCalendarCtrl.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!