Difference between revisions of "Unit Timezone"

From Ultibo.org
Jump to: navigation, search
Line 48: Line 48:
 
----
 
----
  
''To be documented''
+
 
 +
'''System time'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>LPSYSTEMTIME = ^SYSTEMTIME;</code>
 +
 
 +
<code>SYSTEMTIME = _SYSTEMTIME;</code>
 +
 
 +
<code>TSystemTime = SYSTEMTIME;</code>
 +
 
 +
<code>PSystemTime = LPSYSTEMTIME;</code>
 +
 
 +
<code>_SYSTEMTIME = record</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%;"|&nbsp;
 +
|-
 +
| <code>wMonth:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>wDayOfWeek:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>wDay:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>wHour:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>wMinute:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>wSecond:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>wMilliseconds:Word;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</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%;"|&nbsp;
 +
|-
 +
| <code>StandardName:array [0..31] of WCHAR;</code>
 +
| &nbsp;
 +
|-
 +
| <code>StandardDate:SYSTEMTIME;</code>
 +
| &nbsp;
 +
|-
 +
| <code>StandardBias:LONG;</code>
 +
| &nbsp;
 +
|-
 +
| <code>DaylightName:array [0..31] of WCHAR;</code>
 +
| &nbsp;
 +
|-
 +
| <code>DaylightDate:SYSTEMTIME;</code>
 +
| &nbsp;
 +
|-
 +
| <code>DaylightBias:LONG;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</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%;"|&nbsp;
 +
|-
 +
| <code>Description:String[64];</code>
 +
| &nbsp;
 +
|-
 +
| <code>Bias:LongInt;</code>
 +
| &nbsp;
 +
|-
 +
| <code>StandardName:String[32];</code>
 +
| &nbsp;
 +
|-
 +
| <code>StandardBias:LongInt;</code>
 +
| &nbsp;
 +
|-
 +
| <code>StandardStart:TSystemTime;</code>
 +
| &nbsp;
 +
|-
 +
| <code>DaylightName:String[32];</code>
 +
| &nbsp;
 +
|-
 +
| <code>DaylightBias:LongInt;</code>
 +
| &nbsp;
 +
|-
 +
| <code>DaylightStart:TSystemTime;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</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:String;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Description:String;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Bias:LongInt;</code>
 +
| &nbsp;
 +
|-
 +
| <code>StandardName:String;</code>
 +
| &nbsp;
 +
|-
 +
| <code>StandardBias:LongInt;</code>
 +
| &nbsp;
 +
|-
 +
| <code>StandardStart:TSystemTime;</code>
 +
| &nbsp;
 +
|-
 +
| <code>DaylightName:String;</code>
 +
| &nbsp;
 +
|-
 +
| <code>DaylightBias:LongInt;</code>
 +
| &nbsp;
 +
|-
 +
| <code>DaylightStart:TSystemTime;</code>
 +
| &nbsp;
 +
|-
 +
|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 ===

Revision as of 02:35, 26 January 2017

Return to Unit Reference


Description


Ultibo Timezone interface unit

To be documented

Constants



Timezone specific 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 constants TIMEZONE_SIGNATURE_*
TIMEZONE_SIGNATURE = $ED9A1BC3;  


Type definitions



System time

LPSYSTEMTIME = ^SYSTEMTIME;

SYSTEMTIME = _SYSTEMTIME;

TSystemTime = SYSTEMTIME;

PSystemTime = LPSYSTEMTIME;

_SYSTEMTIME = record

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:TSystemTime;  
DaylightName:String[32];  
DaylightBias:LongInt;  
DaylightStart:TSystemTime;  

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:String;  
Description:String;  
Bias:LongInt;  
StandardName:String;  
StandardBias:LongInt;  
StandardStart:TSystemTime;  
DaylightName:String;  
DaylightBias:LongInt;  
DaylightStart:TSystemTime;  
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;
Description: To be documented
Note None documented


Timezone functions

function TimezoneAdd(Data:PTimezoneData; Default:Boolean):LongWord;
Description: Add a Timezone from a timezone data block and to the Timezone table
Note None documented


function TimezoneDelete(Timezone:PTimezoneEntry):LongWord;
Description: To be documented
Note None documented


function TimezoneGetName(Timezone:PTimezoneEntry):String;
Description: To be documented
Note None documented


function TimezoneGetDescription(Timezone:PTimezoneEntry):String;
Description: To be documented
Note None documented


function TimezoneGetBias(Timezone:PTimezoneEntry):LongInt;
Description: To be documented
Note None documented


function TimezoneGetState(Timezone:PTimezoneEntry):LongWord;
Description: To be documented
Note None documented


function TimezoneGetActiveBias(Timezone:PTimezoneEntry):LongInt;
Description: To be documented
Note None documented


function TimezoneGetStandardName(Timezone:PTimezoneEntry):String;
Description: To be documented
Note None documented


function TimezoneGetStandardBias(Timezone:PTimezoneEntry):LongInt;
Description: To be documented
Note None documented


function TimezoneGetStandardDate(Timezone:PTimezoneEntry; Next:Boolean):TDateTime;
Description: To be documented
Note None documented


function TimezoneGetStandardStart(Timezone:PTimezoneEntry):TSystemTime;
Description: To be documented
Note None documented


function TimezoneGetDaylightName(Timezone:PTimezoneEntry):String;
Description: To be documented
Note None documented


function TimezoneGetDaylightBias(Timezone:PTimezoneEntry):LongInt;
Description: To be documented
Note None documented


function TimezoneGetDaylightDate(Timezone:PTimezoneEntry; Next:Boolean):TDateTime;
Description: To be documented
Note None documented


function TimezoneGetDaylightStart(Timezone:PTimezoneEntry):TSystemTime;
Description: To be documented
Note None documented


function TimezoneFind(const Name:String):PTimezoneEntry;
Description: To be documented
Note None documented


function TimezoneEnumerate(Callback:TTimezoneEnumerate; Data:Pointer):LongWord;
Description: To be documented
Note None documented


Timezone helper functions

function TimezoneGetCount:LongWord; inline;
Description: Get the current timezone count
Note None documented


function TimezoneGetDefault:PTimezoneEntry; inline;
Description: Get the current default timezone
Note None documented


function TimezoneSetDefault(Timezone:PTimezoneEntry):LongWord;
Description: Set the current default timezone
Note None documented


function TimezoneCheck(Timezone:PTimezoneEntry):PTimezoneEntry;
Description: Check if the supplied Timezone is in the Timezone table
Note None documented


function TimezoneUpdateOffset:LongWord;
Description: To be documented
Note None documented


function TimezoneStartToDateTime(const AStart:TSystemTime; AYear:Word):TDateTime;
Description: Calculate the start date and time from the start date of a timezone
Note None documented


function TimezoneStartToDescription(const AStart:TSystemTime):String;
Description: Get the description of the start date of a timezone
Note None documented


function TimezoneNameReplaceChar(const AName:String; AChar,AReplace:Char):String;
Description: Same as ReplaceChar in UltiboUtils, reproduced here to avoid including extra units
Note None documented


Return to Unit Reference