system.tag.writeToTag(<date>) fails to update tag

I have created a read/write DateTime memory tag ‘[default]ping/LastPingStartTime’. It’s reading 1970-01-01 in the tag browser.
I’m trying to update it with the following test script.

import datetime

now =
print now
system.tag.writeToTag('[default]ping/LastPingStartTime', now)
  • The print command reports the correct timestamp.
  • The reports the tag value correctly.
  • The tag doesn’t update.

Can anyone find my error?

That worked fine for me, did you set the Data Format on the tag?
Under the Metadata tab, set it to yyyy-MM-dd h:mm:ss aa

Yes, thank you. Data format is correct.
I wonder if I have a permissions problem?

The script console is giving me the following error. “Gateway Comm Mode is not Read/Write.”

Now where do I configure that?

Update 2:
Solved: Project | Comm Read/Write.
Turn that on and it all works.