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
this[object]
Default property to get a timezone by 1-based index or name
public PolarTimeZone this[object pIndex] { get; }
Parameters
pIndex
objectThe 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
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
stringThe 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
ContextThe context used to get the local timezone. Either from the Context.Session or else the SystemTimeZone.
pInputString
stringThe string representing the date/time
pBaseFormat
stringA string indicating the base format for the date. One of: 'MMDDYY', 'DDMMYY', 'YYMMDD'
pTimeZone
PolarTimeZoneA 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
objectThe 1-based index or Windows timezone name.
Returns
- PolarTimeZone
The found timezone. Returns Nothing if not found or out of bounds.