The FORMAT attribute is optional with many meta tags. It specifies how the output of the tag should be formatted.
All tags with an optional FORMAT attribute accept a format string of the form FORMAT=class:format, as detailed following.
Text can be converted as follows:
Words are defined as a sequence of non-whitespace characters delimited by whitespace.
Numbers with at least one whole digit and optional fractional digits can be reformatted.
The format is specified by a comma-delimited list of values in this order:
The following table describes the format of the values that must go in each position.
All eight items must be present, either with a specified value or nothing. For example, if you do not want any formatting for fractional digits there would be nothing between the commas, (,,).
You must address each of the eight items in the number formatting string, even if it is just to let Tango know not to do anything with one or more of the eight numerical formatting items in the list.
Each list item may be a maximum of 15 characters long. Spaces and case are significant.
Do not include spaces unless they are intended. Commas, single quotes, and double quotes can be included by backslash-escaping (for example, \, or \"), or enclosing them in single or double quotes (for example, "," or `''). Anything following a backslash is taken literally.
Here are some examples of numeric formats. -1234.56 is formatted as:
Format |
Format String |
Example |
There are synonyms provided for commonly used format strings.
Example synonyms are listed in the table following with formatted string, -1234567.890.
*US = United States and CA=Canada.
This formatting accepts as input text a sequence of digits, spaces, or punctuation marks, and outputs the digits in one of the following requested formats:
Format* |
Sample Output |
Input Restrictions |
*US = United States and CA=Canada.
The format attribute accepts the "%-" specifiers used by the dateFormat configuration variables, with the addition of a datetime: prefix. For example, datetime:%Y-%m-%d would specify an ODBC-style date (December 1st, 1998 would be formatted as "1998-12-01").
For more information, see dateFormat, timeFormat, timestampFormat.
Tango attempts to guess what the date/time entered actually is. First, the dateFormat, timeFormat, and timestampFormat configuration variables are used to test the input string for a perfect match, and failing these, the procedures as used by the <@ISDATE> family of tags are tested. If the input cannot be determined, a warning is logged and reformatting does not take place.
Tags that accepted a format attribute in previous versions of Tango--<@CURRENTTIME>, <@CURRENTIMESTAMP>, and <@CURRENTDATE>--can be used with the new FORMAT attribute or with their old formatting.
There is only one datetime-class synonym: datetime:http.
datetime:http = datetime:%A, %d-%b-%Y %H:%M:%S GMT.
For more information, see <@TOGMT>.
For example, if the string 1998-09-29
12:34:56 were formatted with datetime:http, the output format
would be
"Monday, 29-Sep-1998 12:34:56 GMT".
Note: datetime:http
formatting does not make any adjustments to the time value to correct to GMT
time. It simply outputs the input timestamp in the HTTP format. To convert a
local time to GMT, use <@TOGMT>.
Copyright © 1999, Pervasive Software. All rights reserved.