Table of Contents

Class PolarTimeZone

Namespace
PolarStudio
Assembly
PolarStudio.dll

This class is a wrapper for a timezone.

public class PolarTimeZone
Inheritance
PolarTimeZone
Inherited Members
Extension Methods

Properties

Caption

Returns the caption (display name)

public string Caption { get; }

Property Value

string

DaylightName

Returns the name for the daylight saving time period.

public string DaylightName { get; }

Property Value

string

Name

Returns the name.

public string Name { get; }

Property Value

string

Obsolete

Returns True if not used anymore.

public bool Obsolete { get; }

Property Value

bool

StandardName

Returns the name for the 'standard' (not-daylight saving time) period.

public string StandardName { get; }

Property Value

string

TimeZone

The underlying TimeZoneInfo object.

public TimeZoneInfo TimeZone { get; }

Property Value

TimeZoneInfo

Methods

LocalDateTimeToUTCdateTime(DateTime, bool)

Converts a local date/time value in this timezone to an UTC date/time value.

public DateTime LocalDateTimeToUTCdateTime(DateTime pLocalDateTime, bool pTwilightZoneDST = false)

Parameters

pLocalDateTime DateTime

The local date/time

pTwilightZoneDST bool

Pass as True if in the 'twilight zone'. When the time switches from 'normal' to DST at 03:00, the clock is set back to 02:00. All times then (say 02:25) happen that night for the second time. This hour we call the 'twilight zone'. These date/time can be marked specifically to let the user know it is the second occurance of that time that night.

Returns

DateTime

The date/time in UTC.

UTCdateTimeToLocalDateTime(DateTime)

Converts an UTC date/time to a local date

public DateTime UTCdateTimeToLocalDateTime(DateTime pUTCdateTime)

Parameters

pUTCdateTime DateTime

The UTC date/time to convert.

Returns

DateTime

A date time in this time zone.

UTCdateTimeToLocalDateTime(DateTime, ref bool, ref string)

Converts an UTC date/time to a local date

public DateTime UTCdateTimeToLocalDateTime(DateTime pUTCdateTime, ref bool pTwilightZoneDST, ref string pActualTimeZoneName)

Parameters

pUTCdateTime DateTime

The UTC date/time to convert.

pTwilightZoneDST bool

This by-ref boolean parameter is set to True if the time takes place in the twilight zone.

pActualTimeZoneName string

This by-ref parameter returns the actual timezone name of the local date/time

Returns

DateTime

A date time in this time zone.