Manipulating Dates in Zope
Is there a way in Zope (preferably in a python script rather than DTML) to manipulate dates so that you can calculate the date, say, six months ahead (regardless of the intermediate months having 28/29/30/31 days)? Some dates must be calculated on increments other than days. For example, a response to something may be due three months from the present date (e.g., February 4, 2002) or five years from the present date (e.g., December 4, 2006). Simply adding days would not take into account months that have more/less than 30 days. Does Zope/python have any tools that can be employed for the above in a python script? Thanks in advance, Ron
All dates inside Zope are represented by instances of the DateTime class (lib/python/DateTime.py). This class and its API is documented in the online help and in the Zope Book (www.zope.org/Members/Michel/ZB). Andreas ----- Original Message ----- From: <complaw@hal-pc.org> To: <zope@zope.org> Sent: Tuesday, December 04, 2001 16:50 Subject: [Zope] Manipulating Dates in Zope
Is there a way in Zope (preferably in a python script rather than DTML) to manipulate dates so that you can calculate the date, say, six months ahead (regardless of the intermediate months having 28/29/30/31 days)?
Some dates must be calculated on increments other than days. For example, a response to something may be due three months from the present date (e.g., February 4, 2002) or five years from the present date (e.g., December 4, 2006). Simply adding days would not take into account months that have more/less than 30 days.
Does Zope/python have any tools that can be employed for the above in a python script?
Thanks in advance,
Ron
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[<complaw@hal-pc.org>]
Is there a way in Zope (preferably in a python script rather than DTML) to manipulate dates so that you can calculate the date, say, six months ahead (regardless of the intermediate months having 28/29/30/31 days)?
Some dates must be calculated on increments other than days. For example, a response to something may be due three months from the present date (e.g., February 4, 2002) or five years from the present date (e.g., December 4, 2006). Simply adding days would not take into account months that have more/less than 30 days.
Does Zope/python have any tools that can be employed for the above in a python script?
mxDateTime has a lot of date capability. It's python, not specifically Zope. Do a search on Google and you should find it. Cheers, Tom P
But usage of mxDateTime is not directly possible in Zope except you use external methods or tweak the security machinery. Andreas ----- Original Message ----- From: "Thomas B. Passin" <tpassin@mitretek.org> To: <zope@zope.org> Sent: Tuesday, December 04, 2001 18:14 Subject: Re: [Zope] Manipulating Dates in Zope
[<complaw@hal-pc.org>]
Is there a way in Zope (preferably in a python script rather than DTML) to manipulate dates so that you can calculate the date, say, six months ahead (regardless of the intermediate months having 28/29/30/31 days)?
Some dates must be calculated on increments other than days. For example, a response to something may be due three months from the present date (e.g., February 4, 2002) or five years from the present date (e.g., December 4, 2006). Simply adding days would not take into account months that have more/less than 30 days.
Does Zope/python have any tools that can be employed for the above in a python script?
mxDateTime has a lot of date capability. It's python, not specifically Zope. Do a search on Google and you should find it.
Cheers,
Tom P
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Andreas Jung]
But usage of mxDateTime is not directly possible in Zope except you use external methods or tweak the security machinery.
True, but if it turns out that the built-in date-time tools aren't enough at least it's available. Tom P
Sure, there is already a proposal in the Fishbowl to get rid of DateTime and replace it by mxDateTime. This will properly go into Zope 3. Andreas ----- Original Message ----- From: "Thomas B. Passin" <tpassin@mitretek.org> To: <zope@zope.org> Sent: Wednesday, December 05, 2001 10:39 Subject: Re: [Zope] Manipulating Dates in Zope
[Andreas Jung]
But usage of mxDateTime is not directly possible in Zope except you use external methods or tweak the security machinery.
True, but if it turns out that the built-in date-time tools aren't enough at least it's available.
Tom P
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
At 10:49 AM 12/5/2001 -0500, Andreas Jung wrote:
Sure, there is already a proposal in the Fishbowl to get rid of DateTime and replace it by mxDateTime. This will properly go into Zope 3.
AND THE WORLD REJOICED! FINALLY! :-) Regards, Stephan -- Stephan Richter CBU - Physics and Chemistry Student Web2k - Web Design/Development & Technical Project Management
On Wed, Dec 05, 2001 at 10:49:25AM -0500, Andreas Jung wrote:
Sure, there is already a proposal in the Fishbowl to get rid of DateTime and replace it by mxDateTime. This will properly go into Zope 3.
Is there any chance Zope Corporation incorporates mxDateTime into Python core, not Zope? Oleg. -- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
Both Guido and Marc-Andre answered this question with "no". Andreas ----- Original Message ----- From: "Oleg Broytmann" <phd@phd.pp.ru> To: <zope@zope.org> Sent: Wednesday, December 05, 2001 11:00 Subject: Re: [Zope] Manipulating Dates in Zope
On Wed, Dec 05, 2001 at 10:49:25AM -0500, Andreas Jung wrote:
Sure, there is already a proposal in the Fishbowl to get rid of DateTime and replace it by mxDateTime. This will properly go into Zope 3.
Is there any chance Zope Corporation incorporates mxDateTime into Python core, not Zope?
Oleg. -- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On Wed, Dec 05, 2001 at 11:08:09AM -0500, Andreas Jung wrote:
Both Guido and Marc-Andre answered this question with "no".
License problems? Oleg. -- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
At 07:07 PM 12/5/2001 +0300, you wrote:
On Wed, Dec 05, 2001 at 11:08:09AM -0500, Andreas Jung wrote:
Both Guido and Marc-Andre answered this question with "no".
License problems?
No, the License is good. They said it is not Pythonic enough, which I can see. Maybe they build a nicer module? The question they did not answer was how to make a nicer, more Pythonic module... Regards, Stephan -- Stephan Richter CBU - Physics and Chemistry Student Web2k - Web Design/Development & Technical Project Management
On Wed, Dec 05, 2001 at 10:20:05AM -0600, Stephan Richter wrote:
No, the License is good. They said it is not Pythonic enough, which I can see. Maybe they build a nicer module? The question they did not answer was how to make a nicer, more Pythonic module...
mxDateTime is not Pythonic? Why?! Oleg. -- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
At 07:24 PM 12/5/2001 +0300, you wrote:
On Wed, Dec 05, 2001 at 10:20:05AM -0600, Stephan Richter wrote:
No, the License is good. They said it is not Pythonic enough, which I can see. Maybe they build a nicer module? The question they did not answer was how to make a nicer, more Pythonic module...
mxDateTime is not Pythonic? Why?!
It is too complex and does not seem as simply as some of the other modules, which is true. The question is only whether you can do it better, but I assume they could (certainly not me). Regards, Stephan -- Stephan Richter CBU - Physics and Chemistry Student Web2k - Web Design/Development & Technical Project Management
participants (6)
-
Andreas Jung -
Andreas Jung -
complaw@hal-pc.org -
Oleg Broytmann -
Stephan Richter -
Thomas B. Passin