Example of requests that cross time zones
- Last Updated: July 2, 2019
- 1 minute read
- Corticon
- Documentation
To call a Decision Service in another time zone, you need to specify the
timezone property so dates and times are correctly
handled.
Note: Time zone name strings are as presented in the TZ column of the table in
Wikipedia's TZ topic. Refer to the Internet
Assigned Numbers Authority (IANA) for time zone changes and updated name assignments.
Consider the following example where the request originates in New York City (-5:00 offset from GMT) to a server in Los Angeles (-8:00 offset from GMT):
<?xml version="1.0" encoding="UTF-8"?>
<CorticonRequest xmlns="urn:Corticon" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" decisionServiceName="timezonetest">
<WorkDocuments>
<Entity_1 id="Entity_1_id_1"/>
</WorkDocuments>
</CorticonRequest>
<?xml version="1.0" encoding="UTF-8"?>
<CorticonResponse xmlns="urn:Corticon" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" decisionServiceName="timezonetest">
<WorkDocuments>
<Entity_1 id="Entity_1_id_1">
<Time1>16:24:35.000-08:00</Time1>
</Entity_1>
</WorkDocuments>
<Messages version="1.0" />
</CorticonResponse>
When the request sets its time zone property, the response adjusts the time offset appropriately:
<?xml version="1.0" encoding="UTF-8"?>
<CorticonRequest xmlns="urn:Corticon" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" decisionServiceName="timezonetest">
<ExecutionProperties>
<ExecutionProperty name="PROPERTY_EXECUTION_TIMEZONE"
value="America/New_York" />
</ExecutionProperties>
<WorkDocuments>
<Entity_1 id="Entity_1_id_1"/>
</WorkDocuments>
</CorticonRequest>
<?xml version="1.0" encoding="UTF-8"?>
<CorticonResponse xmlns="urn:Corticon" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" decisionServiceName="timezonetest">
<ExecutionProperties>
<ExecutionProperty name="PROPERTY_EXECUTION_TIMEZONE"
value="America/New_York" />
</ExecutionProperties>
<WorkDocuments>
<Entity_1 id="Entity_1_id_1">
<Time1>16:24:35.000-05:00</Time1>
</Entity_1>
</WorkDocuments>
<Messages version="1.0" />
</CorticonResponse>
When that same server gets a request indicating that it is using Chicago's time, that time offset (-6:00 offset from GMT) is in the reply:
<?xml version="1.0" encoding="UTF-8"?>
<CorticonRequest xmlns="urn:Corticon" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" decisionServiceName="timezonetest">
<ExecutionProperties>
<ExecutionProperty name="PROPERTY_EXECUTION_TIMEZONE"
value="America/Chicago" />
</ExecutionProperties>
<WorkDocuments>
<Entity_1 id="Entity_1_id_1"/>
</WorkDocuments>
</CorticonRequest>
<?xml version="1.0" encoding="UTF-8"?>
<CorticonResponse xmlns="urn:Corticon" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" decisionServiceName="timezonetest">
<ExecutionProperties>
<ExecutionProperty name="PROPERTY_EXECUTION_TIMEZONE"
value="America/Chicago" />
</ExecutionProperties>
<WorkDocuments>
<Entity_1 id="Entity_1_id_1">
<Time1>15:24:35.000-06:00</Time1>
</Entity_1>
</WorkDocuments>
<Messages version="1.0" />
</CorticonResponse>