System.tag.configure with DateTime

Does anyone know why this does not work? It creates the tag but the value is blank. I am expecting there to be the current date time as the value.

tag = 		tag = {
				"name": "timeChanged",
				"valueSource": "memory",
				"dataType": "DateTime",
				"value": system.date.now()
		}

system.tag.configure(basePath = "[tagProvider]", tags = [tag], collisionPolicy = "m")

is tagProvider correct ? may be try without basePath as :

system.tag.configure(tags = [tag], collisionPolicy = "m")

The tag provider must be correct because it makes the tag. It just is not setting the value.

The value is in milliseconds. Try system.date.toMillis(system.date.now())

1 Like

That worked. Thanks.