ITimeZoneFactory Interface
Used to create time zones.
public interface ITimeZoneFactoryMethods
Section titled “Methods”ITimeZoneFactory.CreateFromId(string) Method
Section titled “ITimeZoneFactory.CreateFromId(string) Method”Creates a time zone based on a given id. The ID can be specified in the following formats: - Custom timezone ID - IANA ID - Window ID
Please note that the IANA and Windows timezones contain adjustment rules. On non NT platforms like Linux, BSD and Mac Os, the Windows ID will map to an equivalent IANA timezone, according to TimeZoneConverter.
<example>IANA ID:
<code>
var ianaTimeZone = timeZoneFactory.CreateFromId(“Europe/Vienna”);
</code></example>
HAKOM.TSM.Net.Api.Time.TimeZones.ITimeZone CreateFromId(string id);Parameters
Section titled “Parameters”The IANA ID, Windows ID or UTC + offset of the time zone.
Returns
Section titled “Returns”ITimeZone
A new instance of ITimeZone.
ITimeZoneFactory.CreateLocal() Method
Section titled “ITimeZoneFactory.CreateLocal() Method”Creates a time zone based on the time zone of the computer/server where the application runs.
HAKOM.TSM.Net.Api.Time.TimeZones.ITimeZone CreateLocal();Returns
Section titled “Returns”ITimeZone
A new instance of ITimeZone.
ITimeZoneFactory.TryCreateFromId(string, ITimeZone) Method
Section titled “ITimeZoneFactory.TryCreateFromId(string, ITimeZone) Method”A non throwing variant of: CreateFromId(string).
bool TryCreateFromId(string id, out HAKOM.TSM.Net.Api.Time.TimeZones.ITimeZone? timeZone);Parameters
Section titled “Parameters”The id to use
timeZone ITimeZone
If successful, contains the time zone.
Returns
Section titled “Returns”System.Boolean
True if successful