C# Класс OpenSlx.Lib.SlxDataHelpers.TimeZoneConvert

Utility methods for converting timezones. For web users, the timezone will be stored in the HttpContext. We can retrieve it via Sage's ContextService. For Unit-Test, this can be set explicitely in the suite setup.
Показать файл Открыть проект

Открытые методы

Метод Описание
ToLocal ( System.DateTime input ) : DateTime?

Convert the datetime (assumed to be UTC) to the user's local time zone.

ToUtc ( System.DateTime input ) : DateTime?

Convert the datetime to UTC. The input datetime will be assumed to be in the local user timezone (not necessarily the same as the server's).

Приватные методы

Метод Описание
GetTimeZoneContext ( ) : Sage.Platform.TimeZone

Описание методов

ToLocal() публичный статический Метод

Convert the datetime (assumed to be UTC) to the user's local time zone.
public static ToLocal ( System.DateTime input ) : DateTime?
input System.DateTime
Результат DateTime?

ToUtc() публичный статический Метод

Convert the datetime to UTC. The input datetime will be assumed to be in the local user timezone (not necessarily the same as the server's).
public static ToUtc ( System.DateTime input ) : DateTime?
input System.DateTime
Результат DateTime?