# Copy Timestamp to property

**URL:** <https://forum.inductiveautomation.com/t/copy-timestamp-to-property/10461>\
**Category:** Ignition\
**Created:** [September 14, 2015, 3:59pm UTC](https://forum.inductiveautomation.com/t/copy-timestamp-to-property/10461 "2015-09-14T15:59:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jreynolds](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jreynolds](https://forum.inductiveautomation.com/u/jreynolds)\
**Post date:** [September 14, 2015, 3:59pm UTC](https://forum.inductiveautomation.com/t/copy-timestamp-to-property/10461/1 "2015-09-14T15:59:03Z")

</div>

I’m wanting to copy the current date time when a scripting event happens. I can’t seem to get the code right.

`strTime = event.source.parent.PT.StartTime
strTime.today()`

Gives me this error

[code]Traceback (most recent call last):  
File “event:actionPerformed”, line 2, in   
AttributeError: ‘java.util.Date’ object has no attribute ‘today’

```
at org.python.core.Py.AttributeError(Py.java:173)
at org.python.core.PyObject.noAttributeError(PyObject.java:930)
at org.python.core.PyObject.object ___getattribute__ (PyObject.java:3692)
at org.python.core.PyObject$object ___getattribute___ exposer. __call__ (Unknown Source)
at org.python.core.Deriveds. __findattr_ex__ (Deriveds.java:59)
at org.python.core.PyObjectDerived. __findattr_ex__ (PyObjectDerived.java:983)
at org.python.core.PyObject. __getattr__ (PyObject.java:923)
at org.python.pycode._pyx175.f$0(<event:actionPerformed>:2)
at org.python.pycode._pyx175.call_function(<event:actionPerformed>)
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1275)
at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:624)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:168)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:265)
at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:55)
at com.sun.proxy.$Proxy22.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

```

Ignition v7.7.4 (b2015033012)  
Java: Oracle Corporation 1.8.0\_51  
[/code]

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [September 14, 2015, 4:56pm UTC](https://forum.inductiveautomation.com/t/copy-timestamp-to-property/10461/2 "2015-09-14T16:56:27Z")

</div>

This works:

`
from java.util import Date
currentDateAndTime = Date()
`Best,
