%TimeToStrMono function


Function
The function gets back a time as monotonous time in a time zone UTC+offset in the form of a text string that has been formatted according to entered mask.
Declaration
TEXT %TimeToStrMono(
   TIME in TimeA,
   TEXT in maska,
   INT in offset
 )
Parameters
TimeAAbsolute time.
maskTime format in the final string.
offsetOffset 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.

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

StringDescription
rrrr or yyyy4-digit year representation.
rr or yyLast two digits of the year.
mmMonth
ddDay
hhHour
miMinute
ssSecond
mssMillisecond

Only the first appearance of given time component in mask is being replaced. In case of multiple masks of the same time component with different lengths (e.g. yy and yyyy), only the longest one will be replaced.
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
 

0 komentárov

Nie ste prihlásený. Akékoľvek zmeny, ktoré vykonáte, sa označia ako anonymné. Ak už máte svoj účet, pravdepodobne sa budete chcieť prihlásiť .