hi, i've been sweating with datetime objects the whole day, but still cant figure out some simple things: - documentation ? only in the zope api reference? - how do i make a datetime object which is now+2 hours? i'm sure there is a simple way, ... like DateTime()+2 which would be great if i could add hours, minutes or seconds so easy ... thanks for the help jonatan
object_right_now_plus_two_hours = DateTime(int(DateTime()) + 7200) default_formatted = str(object_right_now_plus_two_hours) Ausum ----- Original Message ----- From: "jonatan" <jonatanpelikan@freemail.hu> To: <zope@zope.org> Sent: Wednesday, November 13, 2002 3:27 PM Subject: [Zope] how to use datetime?
hi,
i've been sweating with datetime objects the whole day, but still cant figure out some simple things:
- documentation ? only in the zope api reference? - how do i make a datetime object which is now+2 hours?
i'm sure there is a simple way, ... like DateTime()+2 which would be great if i could add hours, minutes or seconds so easy ...
thanks for the help
jonatan
_______________________________________________ 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 )
jonatan, there are some examples here: http://zdp.zope.org/projects/zsnippet/snippets/DTMLTags/ZTformatting it's in a DTML context, but the code is all python also, have a look at the source code to see how it works [zope root dir]/lib/python/DateTime/DateTime.py and the documentation [zope root dir]/lib/python/DateTime/DateTime.html you can find it in the CVS tree if you can't get access to the source: http://cvs.zope.org/~checkout~/Zope/lib/python/DateTime/DateTime.html hope this helps ben jonatan wrote:
hi,
i've been sweating with datetime objects the whole day, but still cant figure out some simple things:
- documentation ? only in the zope api reference? - how do i make a datetime object which is now+2 hours?
i'm sure there is a simple way, ... like DateTime()+2 which would be great if i could add hours, minutes or seconds so easy ...
thanks for the help
jonatan
_______________________________________________ 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 )
jonatan writes:
i've been sweating with datetime objects the whole day, but still cant figure out some simple things:
- documentation ? only in the zope api reference? There is a beautifull documentation in the "DateTime" folder....
- how do i make a datetime object which is now+2 hours? Already answered by someone else.
Dieter
participants (4)
-
Ausum Studio -
Ben Avery -
Dieter Maurer -
jonatan