Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 2.2 KB

retrieve-time-zone-information.md

File metadata and controls

53 lines (37 loc) · 2.2 KB
title description ms.date author ms.author ms.reviewer ms.topic search.audienceType contributors
Sample: Retrieve time zone information (Microsoft Dataverse) | Microsoft Docs
This sample shows how to retrieve time zone information
04/03/2022
JimDaly
jdaly
pehecke
sample
developer
JimDaly
phecke

Sample: Retrieve time zone information

This sample shows how to retrieve time zone information.

[!div class="nextstepaction"] SDK for .NET: Retrieve time zone information sample code

How to run this sample

[!includecc-how-to-run-samples]

What this sample does

The RetrieveAllTimeZonesForLocale method is intended to be used in a scenario where it uses the current locale id to retrieve all the time zones.

How this sample works

In order to simulate the scenario described in What this sample does, the sample will do the following:

Setup

Checks for the current version of the org.

Demonstrate

  1. The RetrieveCurrentUSerSettings method retrieves the current users timezone code and locale id.
  2. The RetrieveAllTimeZonesForLocale method uses the current locale id and retrieves all the time zones.
  3. The GetTimeZoneCodeByLocaleAndName method retrieves the timezone by name and locale id.
  4. The RetrieveTimeZoneById method retrieves the timezone by id.
  5. The RetrieveTimeZonesLessThan50 method retrieves time zones less than 50.
  6. The RetrieveLocalTimeFromUTCTime method retrieves the local time from UTC time.
  7. The RetrieveUTCTimeFromLocalTime method retrieves the UTC time from the locale time.

Clean up

Display an option to delete the sample data that is created in Setup. The deletion is optional in case you want to examine the tables and data created by the sample. You can manually delete the records to achieve the same result.

[!INCLUDEfooter-include]