swirl Guide to OmniMark 5   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesOMX VariablesErrors
 
      Other Library Functions  
function   add-to-ymdhms    

Library: omdate - date and time functions
Include: omdate.xin
Return type: String
Returns:       

Returns the modified date/time in "YYYYMMDDhhmmss+ZHZM" format.


Declaration

  define stream function add-to-ymdhms
                          value stream ymdhms
                   years value integer years-to-add optional initial {0}
                  months value integer months-to-add optional initial {0}
                    days value integer days-to-add optional initial {0}
                   hours value integer hours-to-add optional initial {0}
                 minutes value integer minutes-to-add optional initial {0}
                 seconds value integer 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:

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

Example:

   ; Add one year to the current date 
  include "omdate.xin"
  process
    local stream ymdhms initial {"20000616162045+0500"}
    local integer years-to-add initial {1}
    local stream foo
    set foo to add-to-ymdhms ymdhms years years-to-add
    output "Current date          = " || ymdhms || "%n"
    output "Current date + 1 year = " || foo
  ; Output: "Current date          = 20000616162045+0500
  ;          Current date + 1 year = 20010616162045+0500"

        Other Library Functions
   add-to-ymdhms
   arpadate-to-ymdhms
   format-ymdhms
   now-as-ymdhms
   round-down-ymdhms
   round-up-ymdhms
   ymd-weekday
   ymdhms-adjust-time-zone
   ymdhms-day-difference
   ymdhms-julian-day-count
   ymdhms-month-difference
   ymdhms-second-difference
   ymdhms-to-arpadate
 
----  

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ OMX ] [ OMX ] [ ERRORS ]

Generated: August 11, 2000 at 3:06:58 pm
If you have any comments about this section of the documentation, send email to docerrors@omnimark.com

Copyright © OmniMark Technologies Corporation, 1988-2000.