dateArithmetic

Hello All
When I use the dateArithmetic function I get the msg …
‘dateArithmetic is not defined’
Any help appreciated.
Thx
Steve Hargraves

Steven

If you are trying to use “dateArithmetic” in a script then it won’t work because its is an expression and only used in expression tag bindings.

If you want some date arithmetic in scripts then take a look here

https://docs.python.org/2/library/datetime.html

and

http://code.runnable.com/UqC3So_UioYMAAJr/date-arithmetic-for-python-datetime-and-timedelta

to get some ideas

I’ve found that the java date stuff is much easier to work with. Of course that’s just my opinion. Here’s a bit of code that would make two dates, now and 7 days from now:

from java.util import Calendar
now = Calendar.getInstance()
later = now.clone()
later.add(Calendar.DATE,7)
print now.getTime()
print later.getTime()

I think what I like about using java stuff is the documentation is much better than jython’s.

Thank you for your prompt replies.
Steve Hargraves