Table of Contents

Class PolarTimeZones

Namespace
PolarStudio
Assembly
PolarStudio.dll

This class contains all the found timezones.

public class PolarTimeZones : IEnumerable
Inheritance
PolarTimeZones
Implements
Inherited Members
Extension Methods

Properties

Count

Returns the number of timezones in this collection.

public int Count { get; }

Property Value

int

this[object]

Default property to get a timezone by 1-based index or name

public PolarTimeZone this[object pIndex] { get; }

Parameters

pIndex object

The 1-based index or Windows timezone name.

Property Value

PolarTimeZone

The found timezone. Throws an exception if not found or out of bound.

SystemTimeZone

Returns the time zone used by the system (server)

public PolarTimeZone SystemTimeZone { get; }

Property Value

PolarTimeZone

Methods

GetEnumerator()

The enumerator.

public IEnumerator GetEnumerator()

Returns

IEnumerator

The enumerator.

GetTimeZoneByName(string)

Returns the timezone by either the Windows name or the Iana name.

public PolarTimeZone GetTimeZoneByName(string pTimeZoneName)

Parameters

pTimeZoneName string

The name of the time zone.

Returns

PolarTimeZone

The found timezone or Nothing if not found.

StringToDate(Context, string, string, PolarTimeZone)

Converts a string with a local/date time to a UTC date/time as if it were entered in the time zone that is derived from the specified context.

public static DateTime StringToDate(Context pContext, string pInputString, string pBaseFormat, PolarTimeZone pTimeZone = null)

Parameters

pContext Context

The context used to get the local timezone. Either from the Context.Session or else the SystemTimeZone.

pInputString string

The string representing the date/time

pBaseFormat string

A string indicating the base format for the date. One of: 'MMDDYY', 'DDMMYY', 'YYMMDD'

pTimeZone PolarTimeZone

A specific time zone to overrule the automatically derived timezone.

Returns

DateTime

A UTC date time in the found time zone

Exceptions

PolarException

Throws an exception in case of failure.

TryGet(object)

Helpter to get a timezone by 1-based index or Windows or Iana name

public PolarTimeZone TryGet(object pIndex)

Parameters

pIndex object

The 1-based index or Windows timezone name.

Returns

PolarTimeZone

The found timezone. Returns Nothing if not found or out of bounds.