Udostępnij za pośrednictwem


Managing Time Zones with Web Services

Microsoft Dynamics NAV Server provides a Services Default Time Zone setting for defining the time zone in which web service calls run. This setting affects both SOAP and OData web services, in addition to NAS Services.

Time Zone Configuration

You can configure the Services Default Time Zone using the Microsoft Dynamics NAV Server Administration Tool, Microsoft Dynamics NAV Windows PowerShell Cmdlets, or by directly editing CustomSettings.config, the configuration file for the relevant Microsoft Dynamics NAV Server instance. The following table describes the possible values for the Services Default Time Zone setting.

Value Description
UTC Specifies that all business logic for services on the server instance runs in Coordinated Universal Time (UTC). This is the default value. This is how web services business logic was handled in Microsoft Dynamics NAV 2009 SP1 and Microsoft Dynamics NAV 2009.
Server Time Zone Specifies that services use the time zone of the computer that is running Microsoft Dynamics NAV Server.
ID of any Windows time zone Specifies that services use a Windows time zone as defined in the system registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. For example, Romance Standard Time is a valid Windows time zone value.

When a web service writes data back to Dynamics NAV, dates and times are based on the setting of the Services Default Time Zone setting. However, the web service consumer can override the setting and specify a different time zone.

Note

Microsoft Dynamics NAV Server stores dates and times as UTC. When a web service receives data from Microsoft Dynamics NAV Server, the time zone is UTC even if the Services Default Time Zone setting is set to a different time zone.

For example, if the Services Default Time Zone setting is set to UTC+3, the following table describes two scenarios where a web service consumer modifies Dynamics NAV data and sends this back to Microsoft Dynamics NAV Server.

Web service changes the DateTime field to Microsoft Dynamics NAV Server interprets the DateTime value as Microsoft Dynamics NAV Server saves the DateTime value as
01/01/2014 17:00 UTC+1 01/01/2014 17:00 UTC+1 01/01/2014 16:00 UTC
01/01/2014 17:00 01/01/2014 17:00 UTC+3 01/01/2014 14:00 UTC

See Also

Communicating with Microsoft Dynamics NAV Clients in Different Time Zones
Microsoft Dynamics NAV Server Administration Tool
Microsoft Dynamics NAV Windows PowerShell Cmdlets