swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax    
operator  

date

 

 

Return type: String
Returns:       

The formatted date string.



Syntax
  date string-expression


Purpose

date returns the current date and time.

The date operator must be followed by a string expression that can contain ordinary characters, format items, and date format items. Ordinary characters are passed through unchanged, and the format items are replaced with the appropriate values.

For example, the following process rule will output the current date in a "YY/MM/DD" format, and it will output the time the program was compiled in an "HH:MM:SS" format:

  process
     output date "=Y/=M/=D" || "%n"
     output compiled-date "=h:=m:=s" || "%n"

The equals sign (=) is the first character in a date format item, akin to the percent sign (%) that is the first character in a regular format item. The slash and colon characters that appear in this example are regular characters, which pass through unchanged to the appropriate variable.

Format items for date and compiled-date

Date and compiled-date format items begin with an "=" character and have the following meanings:

Specifying the "x" modifier, as shown in the above list, causes the OmniMark program to return as few or as many digits as necessary to provide accurate and complete information. If you leave the "x" qualifier out, everything will be presented with two digits. For example, the date February 29, 1996 would be represented as follows:

Without the "x", single-digit values are zero padded, two-digit values appear as is, and a four-digit year appears in a two-digit field, so its leading two digits are truncated. Use "=xY", which will give you the full year number, to avoid Year-2000-like problems in cases where the date is later be used by other computer programs.

    Related Syntax
   compiled-date
 
 
 

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

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

Copyright © Stilo Corporation, 1988-2005.