%AddIntervalLocal function


Function
The function adds relative time TimeR to absolute time TimeA. The result is a value of the Absolute time type.
Declaration


TIME %AddIntervalLocal(
   TIME in TimeA,
   REAL in TimeR,
   TEXT in timeZone := %GetCurrentTimeZone()
 )


Parameters


TimeAAbsolute time.
TimeRRelative time.
timeZone


Description
The function %AddIntervalLocal adds relative time to the absolute one. The result will not be influenced by the fact that the time jump (between summer and winter time) was or was not performed in this interval. E.g., if 3 hours are added to 1:00 a.m., the result is always 4:00 a.m.
Example


; =================================================================
;  Using time zone "Europe/Bratislava"
;  Daylight saving time was observed in the year 2009, therefore time shifts occurred.
;  Winter [B] time was 1 hour ahead of UTC, summer [A] time was 2 hours ahead of UTC.
;  Summer time was from 29th March 2009 to 24th October 2009.
;  A3:00:00 is changed to B2:00:00 on Sunday (25th October 2009).
; =================================================================

BEGIN
  TIME _baseTime
  TIME _addLocal1
  TIME _addLocal2

  ; 2009-10-24 23:30:00 UTC / 2009-10-25 01:30:00 UTC+02
  _baseTime := %StrToTimeEx("2009-10-25 01:30:00", "yyyy-mm-dd hh:mi:ss", "Europe/Bratislava")

  ; add 1 hour - result time 2009-10-25 A2:30:00.000 UTC+02
  _addLocal1 := %AddIntervalLocal(_baseTime, 3600, "Europe/Bratislava")
  ; add 2 hour - result time 2009-10-25 03:30:00.000 UTC+01
  _addLocal2 := %AddIntervalLocal(_baseTime, 7200, "Europe/Bratislava")
END