thank you all for the answers but probably I didn't explain myself.
I'm looking for something to do things like this:
(pseudocode)
import datetime
t = datetime.datetime(2004,9,17)
t + datetime.workingtimedelta(days=1) #workingtimedelta doesn'exist!
datetime.datetime(2004, 9, 20, 0, 0)
Notice that the result would be Monday, not Saturday.
I've found something useful in the quantlib library but it only deals with
days or greater timespans, not hours or minutes as I would like.
import QuantLib
c = QuantLib.Calendar('Italy')
d2 = QuantLib.Date(17,9,2004)
c.addHoliday(d2)
d3 = QuantLib.Date(16,9,2004)
c.advance(d3,1,'Days','Following')
Date(20,9,2004)
It looked as if wx.DateTimeHolidayAuthority could do something for me
I'd check out mxDateTime, it has more than the python one, and it wouldn't be hard to build this function with it if it isn't there.
By the way, has anyone heard of an effort to build a add-on module for the std lib DateTime module? It's nice to have it standard, but it's pretty limited as is.
-Chris
···
m.prosperi@libero.it wrote:
thank you all for the answers but probably I didn't explain myself.
I'm looking for something to do things like this:
t = datetime.datetime(2004,9,17)
t + datetime.workingtimedelta(days=1) #workingtimedelta doesn'exist!
datetime.datetime(2004, 9, 20, 0, 0)
Notice that the result would be Monday, not Saturday.
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
"Chris Barker" <Chris.Barker@noaa.gov> writes:
···
m.prosperi@libero.it wrote:
thank you all for the answers but probably I didn't explain myself.
I'm looking for something to do things like this:
t = datetime.datetime(2004,9,17)
t + datetime.workingtimedelta(days=1) #workingtimedelta doesn'exist!
datetime.datetime(2004, 9, 20, 0, 0)
Notice that the result would be Monday, not Saturday.
I'd check out mxDateTime, it has more than the python one, and it
wouldn't be hard to build this function with it if it isn't there.
By the way, has anyone heard of an effort to build a add-on module for
the std lib DateTime module? It's nice to have it standard, but it's
pretty limited as is.
Check DateUtil: https://moin.conectiva.com.br/DateUtil
It has some interesting additions.
Be seeing you,
--
Godoy. <godoy@ieee.org>
Jorge Godoy wrote:
Check DateUtil: https://moin.conectiva.com.br/DateUtil
thanks, that's exactly what I was looking for!
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
No kidding. That's a nice piece of work. Now I can dump my brittle ISO
and RFC822 parsing routines.
···
On Tue, 2004-09-14 at 13:32 -0700, Chris Barker wrote:
Jorge Godoy wrote:
> Check DateUtil: https://moin.conectiva.com.br/DateUtil
thanks, that's exactly what I was looking for!
--
Cliff Wells <clifford.wells@comcast.net>