C# Class 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.
Mostrar archivo Open project: nicocrm/OpenSlx

Public Methods

Method Description
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).

Private Methods

Method Description
GetTimeZoneContext ( ) : Sage.Platform.TimeZone

Method Details

ToLocal() public static method

Convert the datetime (assumed to be UTC) to the user's local time zone.
public static ToLocal ( System.DateTime input ) : DateTime?
input System.DateTime
return DateTime?

ToUtc() public static method

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
return DateTime?