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

round-down-ymdhms

 
 

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

Returns: Returns the specified date/time rounded down to the nearest indicated interval.


Declaration

define string function round-down-ymdhms value string ymdhms
                                      to value string interval

Argument definitions

ymdhms
a date/time in "YYYYMMDDhhmmss+ZHZM" format
interval
the name of the interval which you want the indicated date rounded to


Purpose

This function takes a date/time in "YYYYMMDDhhmmss+ZHZM" format, and returns the same value but rounded down to the beginning of an interval indicated by the second argument. Only the shortest distinguishing prefix of the interval name is needed, so "y" can be used in place of "year", but "mo" and "mi" are needed to distinguish between "month" and "minute". This argument can be in either uppercase or lowercase. If this argument is unrecognized, the date/time will be returned unchanged.

Example:


  include "omdate.xin"
  process
     local stream now
     set now to now-as-ymdhms
      output "Now, unrounded                  = " 
         || now
         || "%n"
         || "Now, rounded down to the minute = " 
         || round-down-ymdhms now to "mi" 
         || "%n"
  ; Results of this program were:
  ;    Now, unrounded                            = 20010215162804-0500
  ;    Now, rounded down to the minute = 20010215162800-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 ] [ 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.