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

round-up-ymdhms

 
 

Library: General, Date and time functions (OMDATE)
Include: omdate.xin
Return type: String
Returns: 

Returns a specified date/time rounded up to the nearest indicated interval.


Declaration

  define stream function round-up-ymdhms value stream ymdhms
                                      to value stream interval


Purpose

This function takes a date/time in "YYYYMMDDhhmmss+ZHZM" format and returns the same value, but rounded up to the end of an interval as indicated by the second argument.

This function rounds up to the end of a time period, and if you specify round-up-ymdhms now to "mo" the function will round up to the last second in the last minute in the last hour of the month. This is particularly useful for determining the time when licenses or agreements should expire.

Arguments:

Example:

  include "omdate.xin"
  process
     local stream now
     set now to now-as-ymdhms
     output "Now, unrounded                = "
         || now
         || "%n"
         ||"Now, rounded up to the month = "
         || round-up-ymdhms now to "mo"
         || "%n"
  ; Result of this code was:
  ;    Now, unrounded                    = 20010215172442-0500
  ;    Now, rounded up to the month = 20010228235959-0500

        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 ] [ LEGACYLIBRARIES ] [ ERRORS ]

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:45:44 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.