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 |
|
|
This sample shows how to retrieve time zone information.
[!div class="nextstepaction"] SDK for .NET: Retrieve time zone information sample code
[!includecc-how-to-run-samples]
The RetrieveAllTimeZonesForLocale
method is intended to be used in a scenario where it uses the current locale id to retrieve all the time zones.
In order to simulate the scenario described in What this sample does, the sample will do the following:
Checks for the current version of the org.
- The
RetrieveCurrentUSerSettings
method retrieves the current users timezone code and locale id. - The
RetrieveAllTimeZonesForLocale
method uses the current locale id and retrieves all the time zones. - The
GetTimeZoneCodeByLocaleAndName
method retrieves the timezone by name and locale id. - The
RetrieveTimeZoneById
method retrieves the timezone by id. - The
RetrieveTimeZonesLessThan50
method retrieves time zones less than 50. - The
RetrieveLocalTimeFromUTCTime
method retrieves the local time from UTC time. - The
RetrieveUTCTimeFromLocalTime
method retrieves the UTC time from the locale time.
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]