swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
      Other Library Functions  
function  

ymdhms-day-difference

 
 

Library: Date and time functions (OMDATE)
Include: omdate.xin
Return type: Integer

Returns: Returns the number of days difference between two given dates.


Declaration

define integer function ymdhms-day-difference
              (value string a, value string b)

Argument definitions

a
the first date in "YYYYMMDDhhmmss+ZHZM" format
b
the second date, also in "YYYYMMDDhhmmss+ZHZM" format


Purpose

This function takes two dates and returns a signed value representing the number of days difference between them. The result is rounded down to the largest number of days less than or equal to the difference. The date/times can be in different time zones.

Example:


  include "omdate.xin"
  process
     local integer elapsed-days
     set elapsed-days to ymdhms-day-difference("19980416155545+0500", "19710401080000+0000")
     output "%d(elapsed-days) days have elapsed between the specified dates/times.%n"
  ; The result of this program is:
  ;      9877 days have elapsed between the specified dates/times.

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

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

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:27:39 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.