User Tools

Site Tools


time_pictures.htm
Navigation:  Language Reference > 3 - Variable Declarations > Picture Tokens >====== Time Pictures ====== Previous pageReturn to chapter overviewNext page

Quick List

User-defined Time pictures

Predefined Time Pictures

@Tn[s][B]

blk2blue.jpg

@T All time pictures begin with @T.
n Determines the time picture format. Time picture formats range from 1 through 8. A leading zero (0) indicates zero-filled hours.
s A separation character. By default, colon ( : ) characters appear between the hour, minute, and second components of certain time picture formats. The following s indicators provide an alternate separation character for these formats.
. (period) Produces periods
' (grave accent) Produces commas
- (hyphen) Produces hyphens
_ (underscore) Produces spaces
B Specifies that the format displays as blank when the value is zero.

Times may be stored in a numeric variable (usually a LONG), a TIME field , or in a STRING declared with a time picture. A time stored in a numeric variable is called a “Standard Time.” The stored value is the number of hundredths of a second since midnight. The picture token converts the value to one of the eight time formats.

For those time pictures which contain string data, the actual strings are customizable in an Environment file (.ENV). See the Internationalization section for more information.

Example:

Picture   Format       Result

@T1       hh:mm        17:30

@T2       hhmm         1730

@T3       hh:mmXM      5:30PM

@T03      hh:mmXM      05:30PM

@T4       hh:mm:ss     17:30:00

@T5       hhmmss       173000

@T6       hh:mm:ssXM   5:30:00PM

@T7                    Windows Control Panel setting for Short Time

@T8                    Windows Control Panel setting for Long Time

 Alternate separators

@T1.      hh.mm        Period separator

@T1-      hh-mm        Dash separator

@T3_      hh mmXM      Underscore produces space separator

@T4'      hh,mm,ss     Grave accent produces comma separator


Coming in a future release

User-Defined Time Pictures

In addition to the 8 predefined Time pictures you can construct your custom Time Picture using the following meta-symbols.

All user-defined date pictures begin with @T  and end with uppercase T. The character % can be equal to C (Capitalize), L (Lower case) or U (Upper case). The optional parts of the meta-symbols are enclosed in square brackets [ ]:

h[*,0] Hours value, one digit (values 0-9)
hh Hours value, always two digits; equivalent to h0
hhh[*,0] Hours value, maximum length is determined by the number of h characters;The required number of filler characters (if used) are added  before the first digit for values with less digits
m[*,0] Minutes value, one digit for values 0-9
mm Minutes value, always two digits; equivalent to m0
mmm[*,0] Minutes value, maximum length is determined by the number of m's;The required number of filler characters (if used) are added before the first digit for values with less digits
s[*,0] Seconds value, one digit for values 0-9
ss Seconds value, two digits always; equivalent to s0
sss[*,0] Seconds value, maximum length is determined by the number of s charactersThe required number of filler characters (if used) are added before the first digit for values with less digits
cc Hundredth of a second;  always two digits
X[%] AM/PM modifier; maximum length is determined by the number of X characters;
H The H (uppercase) meta-symbol forces the FORMAT function to use the 24-hour format for hours. It does not affect DEFORMAT

User-defined Time pictures must begin and end with uppercase T characters (not counting optional B modifier). The optional 0 (zero) and * (asterisk) are filler characters. The default filler character is a space.

The following combinations of meta-symbols for @T pictures are not valid:

·any Hours meta-symbol if the picture has no minutes meta-symbols but does have seconds meta-symbols

·m[*,0] and mmm[*,0] meta-symbols if the picture has any Hours meta-symbol (only mm meta-symbol is valid in this case)

·s[*,0] and sss[*,0] meta-symbols if the picture has any Minutes meta-symbol (only ss meta-symbol is valid in this case)

·cc meta-symbol if the picture has no Seconds meta-symbols

Any other characters are treated as literals. All characters enclosed in double-quotes are treated as literals. To include a double-quote as a literal character, two subsequent double-quote characters must be used.

Examples

@Thh: mm “and” ss “seconds ” (XXU)T 11: 40 and 12 seconds (AM)
@Thh:mm.ssT 11:40.12
@THH:mm.ssT 13:36:52
@TΩ hh:mm.ssT Ω 01:36:52!Unicode literal character
@Thhh0.mm*.ss*.ccT 013.36*.52*.18
@THH “hours and” mm “minutes”T 13 hours and 36 minutes!Note the use of the double quotes so that the 'h' in “hours” and the 'm' in “minutes were not interpreted as meta-symbols
@THHH0 “hours and” mm “minutes”T 013 hours and 36 minutes!Note the use of the double quotes so that the 'h' in “hours” and the 'm' in “minutes were not interpreted as meta-symbols

See Also:

Standard Time

FORMAT

DEFORMAT

Environment Files

time_pictures.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1