%TimeToStrMono function


Function
The function gets back a time as monotonous time in a time zone UTC+offset in the form of text string that has been formatted according to entered mask.
Declaration
TEXT %TimeToStrMono(
   TIME in TimeA,
   TEXT in maska,
   INT in offset
 )

Parameters
TimeA Absolute time.
mask Time format in final string.
offset Advance in seconds that has been added to UTC monotonous time.

Description
Offset which is added to time in time zone UTC is in seconds.

Offset is set in seconds. For example, if time is displayed in Central European Time (CET) the offset must be 3600 s (1 hour) which means the time zone UTC+1.

Position of individual time components is given by the occurrence of the following strings in the entered mask:

String Description
rrrr or yyyy 4-digit year representation.
rr or yy Last two digits of year.
mm Month
dd Day
hh Hour
mi Minute
ss Second
mss Millisecond


Example
 ; =================================================================
 ;  Slovakia (country for this example)
 ;  Time zone is UTC+1.
 ;  There are summer [A] and winter [B] time (with time shifts).
 ;  Summer time is from 29. March 2009 to 24. October 2009.
 ; =================================================================
 
 BEGIN
 
  TIME _timeB
  TEXT _txtTimeB
 
  TIME _timeA
  TEXT _txtTimeA
 
  ; winter time
  _timeB := %StrToTimeEx("14:30:00 1.1.2009", "hh:mi:ss dd-mm-rrrr")
  ; UTC 13:30:00 01-01-2009, result 14:30:00 01-01-2009
  _txtTimeB := %TimeToStrMono(_timeB, "hh:mi:ss dd-mm-rrrr", 3600)
 
  ; summer time
  _timeA := %StrToTimeEx("14:30:00 1.8.2009", "hh:mi:ss dd-mm-rrrr")
  ; UTC 12:30:00 01-08-2009, result 13:30:00 01-08-2009
  _txtTimeA := %TimeToStrMono(_timeA, "hh:mi:ss dd-mm-rrrr", 3600)
 
 END
 

Napíšte komentár