add-to-ymdhms
Full Description
swirl
Syntax
  define stream function add-to-ymdhms
                          value stream ymdhms
                   years value counter years-to-add optional initial {0}
                  months value counter months-to-add optional initial {0}
                    days value counter days-to-add optional initial {0}
                   hours value counter hours-to-add optional initial {0}
                 minutes value counter minutes-to-add optional initial {0}
                 seconds value counter seconds-to-add optional initial {0}


Purpose

This function takes a date/time in "YYYYMMDDhhmmss+ZHZM" format and any number of values to add or subtract from the given date/time. After the new date/time has been calculated, it is returned in "YYYYMMDDhhmmss+ZHZM" format.

Arguments:

  • "ymdhms" -- the initial date/time in "YYYYMMDDhhmmss+ZHZM" format.
  • "years-to-add" -- a signed numeric value representing the number of years you wish to add or subtract from the initial date/time.
  • "months-to-add" -- a signed numeric value representing the number of months you wish to add or subtract from the initial date/time.
  • "days-to-add" -- a signed numeric value representing the number of days you wish to add or subtract from the initial date/time.
  • "hours-to-add" -- a signed numeric value representing the number of hours you wish to add or subtract from the initial date/time.
  • "minutes-to-add" -- a signed numeric value representing the number of minutes you wish to add or subtract from the initial date/time.
  • "seconds-to-add" -- a signed numeric value representing the number of seconds you wish to add or subtract from the initial date/time.

Note that all except the "ymdhms" argument are optional, and that the default value of all optional arguments is 0 (zero).

Example:

  process
     local stream t100
     set t100 to add-to-ymdhms now-as-ymdhms hours 100
     output "Now + 100 hours = " || t100 || "%n"

Copyright © OmniMark Technologies Corporation, 1988-1998.