marklogic-community / marklogic-state-conductor

An event-based state-machine engine for manipulating MarkLogic database documents.
Other
1 stars 4 forks source link

Change the State conductor dates to take into account the timezone #152

Closed freshie closed 3 years ago

freshie commented 3 years ago

Change the State conductor dates to take into account the timezone.

Right now the State conductor use the new Date(); javascript function. This does not take into effect the time zone be default, it uses UTC. In order for it to take into account the time zone you need tell it which timezone to use. Because of this it makes sense to change to fn.timezoneFromDate() function where it uses the server time, which does take into account The time zone.

There are a few places where this happens in the state conductor code each of them should be evaluated and changed.

example problem with code on a MarkLogic server with timezone as EST

const jsDate = new Date(); const currentDateTime = fn.currentDateTime() let result = [jsDate, currentDateTime ]

result //output//

[ "2021-03-18T15:26:20.831", "2021-03-18T11:26:20.8309851-04:00" ]