Difference between revisions of "Unit Timezone"
(14 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
---- | ---- | ||
− | '' | + | '''Ultibo Timezone Interface unit''' |
=== Constants === | === Constants === | ||
---- | ---- | ||
− | '' | + | |
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Timezone specific constants''' <code> TIME_ZONE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>TIME_ZONE_ID_UNKNOWN = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>TIME_ZONE_ID_STANDARD = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>TIME_ZONE_ID_DAYLIGHT = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>TIME_ZONE_ID_INVALID = DWORD($FFFFFFFF);</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Timezone signature''' <code> TIMEZONE_SIGNATURE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>TIMEZONE_SIGNATURE = $ED9A1BC3;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Type definitions === | === Type definitions === | ||
---- | ---- | ||
− | '' | + | |
+ | '''System time''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>LPSYSTEMTIME = SysUtils.LPSYSTEMTIME;</code> | ||
+ | |||
+ | <code>SYSTEMTIME = SysUtils.SYSTEMTIME;</code> | ||
+ | |||
+ | <code>TSystemTime = SysUtils.TSystemTime;</code> | ||
+ | |||
+ | <code>PSystemTime = SysUtils.PSystemTime;</code> | ||
+ | |||
+ | <code>_SYSTEMTIME = SysUtils.SYSTEMTIME;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>wYear:Word;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>wMonth:Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>wDayOfWeek:Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>wDay:Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>wHour:Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>wMinute:Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>wSecond:Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>wMilliseconds:Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Timezone information''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>TIME_ZONE_INFORMATION = _TIME_ZONE_INFORMATION;</code> | ||
+ | |||
+ | <code>LPTIME_ZONE_INFORMATION = ^TIME_ZONE_INFORMATION;</code> | ||
+ | |||
+ | <code>TTimeZoneInformation = TIME_ZONE_INFORMATION;</code> | ||
+ | |||
+ | <code>PTimeZoneInformation = PTIME_ZONE_INFORMATION;</code> | ||
+ | |||
+ | <code>PTIME_ZONE_INFORMATION = ^TIME_ZONE_INFORMATION;</code> | ||
+ | |||
+ | <code>_TIME_ZONE_INFORMATION = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Bias:LONG;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>StandardName:array [0..31] of WCHAR;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>StandardDate:SYSTEMTIME;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>StandardBias:LONG;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DaylightName:array [0..31] of WCHAR;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DaylightDate:SYSTEMTIME;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DaylightBias:LONG;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Timezone data''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PTimezoneData = ^TTimezoneData;</code> | ||
+ | |||
+ | <code>TTimezoneData = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Name:String[32];</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>Description:String[64];</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Bias:LongInt;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>StandardName:String[32];</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>StandardBias:LongInt;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>StandardStart:SYSTEMTIME;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DaylightName:String[32];</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DaylightBias:LongInt;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DaylightStart:SYSTEMTIME;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Timezone enumeration callback''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TTimezoneEnumerate = function(Timezone:PTimezoneEntry; Data:Pointer):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Timezone entry''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PTimezoneEntry = ^TTimezoneEntry;</code> | ||
+ | |||
+ | <code>TTimezoneEntry = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Timezone Properties'' | ||
+ | |- | ||
+ | | <code>Signature:LongWord;</code> | ||
+ | | Signature for entry validation | ||
+ | |- | ||
+ | | <code>Name:array[0..TIMEZONE_NAME_LENGTH - 1] of Char;</code> | ||
+ | | Timezone name | ||
+ | |- | ||
+ | | <code>Description:array[0..TIMEZONE_DESC_LENGTH - 1] of Char;</code> | ||
+ | | Timezone description | ||
+ | |- | ||
+ | | <code>Bias:LongInt;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>StandardName:array[0..TIMEZONE_NAME_LENGTH - 1] of Char;</code> | ||
+ | | Standard name | ||
+ | |- | ||
+ | | <code>StandardBias:LongInt;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>StandardStart:SYSTEMTIME;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DaylightName:array[0..TIMEZONE_NAME_LENGTH - 1] of Char;</code> | ||
+ | | Daylight name | ||
+ | |- | ||
+ | | <code>DaylightBias:LongInt;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DaylightStart:SYSTEMTIME;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Prev:PTimezoneEntry;</code> | ||
+ | | Previous entry in Timezone table | ||
+ | |- | ||
+ | | <code>Next:PTimezoneEntry;</code> | ||
+ | | Next entry in Timezone table | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Public variables === | === Public variables === | ||
---- | ---- | ||
− | '' | + | ''None defined'' |
=== Function declarations === | === Function declarations === | ||
Line 33: | Line 247: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 48: | Line 262: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 60: | Line 274: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 72: | Line 286: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 84: | Line 298: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 96: | Line 310: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 103: | Line 317: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">function TimezoneGetState(Timezone:PTimezoneEntry):LongWord;</pre> | + | <pre style="border: 0; padding-bottom:0px;">function TimezoneGetState(Timezone:PTimezoneEntry):LongWord; inline;</pre> |
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the state of the supplied Timezone at the current date and time</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Timezone |
− | | | + | | The timezone entry to get the state for |
+ | |- | ||
+ | ! Return | ||
+ | | The TIME_ZONE_ID_* constant representing the standard / daylight state of the timezone | ||
|- | |- | ||
|} | |} | ||
Line 115: | Line 332: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">function | + | <pre style="border: 0; padding-bottom:0px;">function TimezoneGetStateEx(Timezone:PTimezoneEntry; const DateTime:TDateTime):LongWord;</pre> |
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the state of the supplied Timezone at the specified date and time</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! ''' | + | ! Timezone |
− | | | + | | The timezone entry to get the state for |
+ | |- | ||
+ | ! DateTime | ||
+ | | The date and time to get the state of the timezone at | ||
+ | |- | ||
+ | ! Return | ||
+ | | The TIME_ZONE_ID_* constant representing the standard / daylight state of the timezone | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimezoneGetActiveBias(Timezone:PTimezoneEntry):LongInt; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the bias (offset between UTC and Local) of the supplied Timezone at the current date and time</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Timezone | ||
+ | | The timezone entry to get the bias for | ||
+ | |- | ||
+ | ! Return | ||
+ | | The bias in minutes offset between UTC and Local including any daylight bias if active | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimezoneGetActiveBiasEx(Timezone:PTimezoneEntry; const DateTime:TDateTime):LongInt;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the bias (offset between UTC and Local) of the supplied Timezone at the specified date and time</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Timezone | ||
+ | | The timezone entry to get the bias for | ||
+ | |- | ||
+ | ! DateTime | ||
+ | | The date and time to get the bias of the timezone at | ||
+ | |- | ||
+ | ! Return | ||
+ | | The bias in minutes offset between UTC and Local | ||
|- | |- | ||
|} | |} | ||
Line 132: | Line 388: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 144: | Line 400: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 156: | Line 412: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 163: | Line 419: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">function TimezoneGetStandardStart(Timezone:PTimezoneEntry): | + | <pre style="border: 0; padding-bottom:0px;">function TimezoneGetStandardStart(Timezone:PTimezoneEntry):SYSTEMTIME;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 180: | Line 436: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 192: | Line 448: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 204: | Line 460: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 211: | Line 467: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">function TimezoneGetDaylightStart(Timezone:PTimezoneEntry): | + | <pre style="border: 0; padding-bottom:0px;">function TimezoneGetDaylightStart(Timezone:PTimezoneEntry):SYSTEMTIME;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 228: | Line 484: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! '''Note''' | + | ! Note |
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimezoneFindByStandard(const StandardName:String):PTimezoneEntry;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimezoneFindByDaylight(const DaylightName:String):PTimezoneEntry;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
| None documented | | None documented | ||
|- | |- | ||
Line 240: | Line 520: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 250: | Line 530: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">function TimezoneGetCount:LongWord | + | <pre style="border: 0; padding-bottom:0px;">function TimezoneGetCount:LongWord;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current timezone count</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current timezone count</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 262: | Line 542: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">function TimezoneGetDefault:PTimezoneEntry | + | <pre style="border: 0; padding-bottom:0px;">function TimezoneGetDefault:PTimezoneEntry;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current default timezone</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current default timezone</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 279: | Line 559: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 291: | Line 571: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 298: | Line 578: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">function | + | <pre style="border: 0; padding-bottom:0px;">function TimezoneUpdateOffset:LongWord;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 310: | Line 590: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">function TimezoneStartToDateTime(const AStart: | + | <pre style="border: 0; padding-bottom:0px;">function TimezoneUpdateEnvironment:LongWord;</pre> |
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Update the TZ environment variable to represent the current timezone</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | See: https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimezoneStartToDateTime(const AStart:SYSTEMTIME; AYear:Word):TDateTime;</pre> | ||
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Calculate the start date and time from the start date of a timezone</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Calculate the start date and time from the start date of a timezone</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 322: | Line 614: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">function TimezoneStartToDescription(const AStart: | + | <pre style="border: 0; padding-bottom:0px;">function TimezoneStartToDescription(const AStart:SYSTEMTIME):String;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the description of the start date of a timezone</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the description of the start date of a timezone</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 339: | Line 631: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! ''' | + | ! Note |
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimezoneNameToAbbreviation(const AName:String):String;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the abbreviation of a timezone name (eg Central Standard Time = CST)</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
| None documented | | None documented | ||
|- | |- |
Latest revision as of 03:34, 15 October 2024
Return to Unit Reference
Description
Ultibo Timezone Interface unit
Constants
TIME_ZONE_*
TIME_ZONE_ID_UNKNOWN = 0;
|
|
TIME_ZONE_ID_STANDARD = 1;
|
|
TIME_ZONE_ID_DAYLIGHT = 2;
|
|
TIME_ZONE_ID_INVALID = DWORD($FFFFFFFF);
|
TIMEZONE_SIGNATURE_*
TIMEZONE_SIGNATURE = $ED9A1BC3;
|
Type definitions
System time
LPSYSTEMTIME = SysUtils.LPSYSTEMTIME;
SYSTEMTIME = SysUtils.SYSTEMTIME;
TSystemTime = SysUtils.TSystemTime;
PSystemTime = SysUtils.PSystemTime;
_SYSTEMTIME = SysUtils.SYSTEMTIME;
wYear:Word;
|
|
wMonth:Word;
|
|
wDayOfWeek:Word;
|
|
wDay:Word;
|
|
wHour:Word;
|
|
wMinute:Word;
|
|
wSecond:Word;
|
|
wMilliseconds:Word;
|
Timezone information
TIME_ZONE_INFORMATION = _TIME_ZONE_INFORMATION;
LPTIME_ZONE_INFORMATION = ^TIME_ZONE_INFORMATION;
TTimeZoneInformation = TIME_ZONE_INFORMATION;
PTimeZoneInformation = PTIME_ZONE_INFORMATION;
PTIME_ZONE_INFORMATION = ^TIME_ZONE_INFORMATION;
_TIME_ZONE_INFORMATION = record
Bias:LONG;
|
|
StandardName:array [0..31] of WCHAR;
|
|
StandardDate:SYSTEMTIME;
|
|
StandardBias:LONG;
|
|
DaylightName:array [0..31] of WCHAR;
|
|
DaylightDate:SYSTEMTIME;
|
|
DaylightBias:LONG;
|
Timezone data
PTimezoneData = ^TTimezoneData;
TTimezoneData = record
Name:String[32];
|
|
Description:String[64];
|
|
Bias:LongInt;
|
|
StandardName:String[32];
|
|
StandardBias:LongInt;
|
|
StandardStart:SYSTEMTIME;
|
|
DaylightName:String[32];
|
|
DaylightBias:LongInt;
|
|
DaylightStart:SYSTEMTIME;
|
Timezone enumeration callback
TTimezoneEnumerate = function(Timezone:PTimezoneEntry; Data:Pointer):LongWord;
|
Timezone entry
PTimezoneEntry = ^TTimezoneEntry;
TTimezoneEntry = record
Timezone Properties | |
Signature:LongWord;
|
Signature for entry validation |
Name:array[0..TIMEZONE_NAME_LENGTH - 1] of Char;
|
Timezone name |
Description:array[0..TIMEZONE_DESC_LENGTH - 1] of Char;
|
Timezone description |
Bias:LongInt;
|
|
StandardName:array[0..TIMEZONE_NAME_LENGTH - 1] of Char;
|
Standard name |
StandardBias:LongInt;
|
|
StandardStart:SYSTEMTIME;
|
|
DaylightName:array[0..TIMEZONE_NAME_LENGTH - 1] of Char;
|
Daylight name |
DaylightBias:LongInt;
|
|
DaylightStart:SYSTEMTIME;
|
|
Internal Properties | |
Prev:PTimezoneEntry;
|
Previous entry in Timezone table |
Next:PTimezoneEntry;
|
Next entry in Timezone table |
Public variables
None defined
Function declarations
Initialization functions
procedure TimezoneInit;
Note | None documented |
---|
Timezone functions
function TimezoneAdd(Data:PTimezoneData; Default:Boolean):LongWord;
Note | None documented |
---|
function TimezoneDelete(Timezone:PTimezoneEntry):LongWord;
Note | None documented |
---|
function TimezoneGetName(Timezone:PTimezoneEntry):String;
Note | None documented |
---|
function TimezoneGetDescription(Timezone:PTimezoneEntry):String;
Note | None documented |
---|
function TimezoneGetBias(Timezone:PTimezoneEntry):LongInt;
Note | None documented |
---|
function TimezoneGetState(Timezone:PTimezoneEntry):LongWord; inline;
Timezone | The timezone entry to get the state for |
---|---|
Return | The TIME_ZONE_ID_* constant representing the standard / daylight state of the timezone |
function TimezoneGetStateEx(Timezone:PTimezoneEntry; const DateTime:TDateTime):LongWord;
Timezone | The timezone entry to get the state for |
---|---|
DateTime | The date and time to get the state of the timezone at |
Return | The TIME_ZONE_ID_* constant representing the standard / daylight state of the timezone |
function TimezoneGetActiveBias(Timezone:PTimezoneEntry):LongInt; inline;
Timezone | The timezone entry to get the bias for |
---|---|
Return | The bias in minutes offset between UTC and Local including any daylight bias if active |
function TimezoneGetActiveBiasEx(Timezone:PTimezoneEntry; const DateTime:TDateTime):LongInt;
Timezone | The timezone entry to get the bias for |
---|---|
DateTime | The date and time to get the bias of the timezone at |
Return | The bias in minutes offset between UTC and Local |
function TimezoneGetStandardName(Timezone:PTimezoneEntry):String;
Note | None documented |
---|
function TimezoneGetStandardBias(Timezone:PTimezoneEntry):LongInt;
Note | None documented |
---|
function TimezoneGetStandardDate(Timezone:PTimezoneEntry; Next:Boolean):TDateTime;
Note | None documented |
---|
function TimezoneGetStandardStart(Timezone:PTimezoneEntry):SYSTEMTIME;
Note | None documented |
---|
function TimezoneGetDaylightName(Timezone:PTimezoneEntry):String;
Note | None documented |
---|
function TimezoneGetDaylightBias(Timezone:PTimezoneEntry):LongInt;
Note | None documented |
---|
function TimezoneGetDaylightDate(Timezone:PTimezoneEntry; Next:Boolean):TDateTime;
Note | None documented |
---|
function TimezoneGetDaylightStart(Timezone:PTimezoneEntry):SYSTEMTIME;
Note | None documented |
---|
function TimezoneFind(const Name:String):PTimezoneEntry;
Note | None documented |
---|
function TimezoneFindByStandard(const StandardName:String):PTimezoneEntry;
Note | None documented |
---|
function TimezoneFindByDaylight(const DaylightName:String):PTimezoneEntry;
Note | None documented |
---|
function TimezoneEnumerate(Callback:TTimezoneEnumerate; Data:Pointer):LongWord;
Note | None documented |
---|
Timezone helper functions
function TimezoneGetCount:LongWord;
Note | None documented |
---|
function TimezoneGetDefault:PTimezoneEntry;
Note | None documented |
---|
function TimezoneSetDefault(Timezone:PTimezoneEntry):LongWord;
Note | None documented |
---|
function TimezoneCheck(Timezone:PTimezoneEntry):PTimezoneEntry;
Note | None documented |
---|
function TimezoneUpdateOffset:LongWord;
Note | None documented |
---|
function TimezoneUpdateEnvironment:LongWord;
function TimezoneStartToDateTime(const AStart:SYSTEMTIME; AYear:Word):TDateTime;
Note | None documented |
---|
function TimezoneStartToDescription(const AStart:SYSTEMTIME):String;
Note | None documented |
---|
function TimezoneNameReplaceChar(const AName:String; AChar,AReplace:Char):String;
Note | None documented |
---|
function TimezoneNameToAbbreviation(const AName:String):String;
Note | None documented |
---|
Return to Unit Reference