Typecasting redux

Thanks for the replies on the other thread. I see the mistake I made.

I’m still struggling with typecasting though. Let me try another, simpler example:

nowYear = dateExtract(now(0),"year")

yields:

[code]Traceback (most recent call last):
File “event:actionPerformed”, line 20, in
NameError: name ‘dateExtract’ is not defined

[/code]

The help file shows dateExtract as a valid function as follows:

dateExtract(toDate("2003-9-14 8:00:00"), "year")

I am trying to do this in the actionPerformed script of a button.

Thoughts?

Now your conflating the scripting language (Python/Jython) and the expression language. You’ll want to look into Python’s datetime functions: docs.python.org/release/2.5.4/l … etime.html