# Can't call now() from script

**URL:** <https://forum.inductiveautomation.com/t/cant-call-now-from-script/4022>\
**Category:** Ignition\
**Created:** [February 17, 2012, 9:43pm UTC](https://forum.inductiveautomation.com/t/cant-call-now-from-script/4022 "2012-02-17T21:43:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [February 17, 2012, 9:43pm UTC](https://forum.inductiveautomation.com/t/cant-call-now-from-script/4022/1 "2012-02-17T21:43:05Z")

</div>

[inductiveautomation.com/supp … me\_now.htm](http://www.inductiveautomation.com/support/usermanuals/ignition/index.html?gen_date_and_time_now.htm)

How do I set variable equal to now() from event handler script?

How do I call any function from event handler script.

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [February 17, 2012, 9:58pm UTC](https://forum.inductiveautomation.com/t/cant-call-now-from-script/4022/2 "2012-02-17T21:58:35Z")

</div>

The now() function only exists in expression bindings. Expression bindings are separate from scripting functions and cannot be used in scripts. If you want the current time do the following:`from java.util import Date
currentTime = Date()`

---

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [February 17, 2012, 10:10pm UTC](https://forum.inductiveautomation.com/t/cant-call-now-from-script/4022/3 "2012-02-17T22:10:46Z")

</div>

Thank you.
