Previous Topic: DateNext Topic: Timestamp


Time

Time edit patterns extract the time components from a presentation space and construct an internal value in the form HHMMSS. Note that overlap may exist within times as well as for dates, especially in the use of the HH or 24-hour specifier combined with the AM or PM specifier. In these cases, the two groups of specifiers provide derivation information for the same part of the internal value. The action for overlapping specifications is the same for time as it is for date (disagreements are flagged as an error).

When a time edit pattern contains overlapping specifications, then all of the overlapping specifications must be in agreement. Any overlapping specifications that conflict are flagged in error in a left to right scan. The first specification is assumed to be correct, and any subsequent overlap that is in disagreement is flagged as an error. The actual error may be the first component, but editing has no way of knowing this.

The internal storage format for time is a 2400 clock format, regardless of how data is displayed. The use of the 12 specifier and AM or PM specifiers must derive the value based on a 2400 clock. When the 12 specifier is used, then the value of the AM or PM indicator determines whether 12 is added to the value specified by this component. If the AM or PM indicator is not used, but the 12 is used in the edit pattern, then the clock value can never exceed 125959.

Time components that are necessary to fully derive the internal time format (HHMMSS) may be omitted from an edit pattern. When this is the case, then the internal values must be defaulted. Note that these defaults apply to computing the INTERNAL value from specifiers that are OMITTED from the EDIT PATTERN. If the specifiers are used in the edit pattern, and the user omits values for them in the input string, then the pattern flags the value as an error because the user did not enter all of the values specified in the edit pattern.

The following list details the default rules:

The following table illustrates the time input editing behavior.

Presentation

Edit Pattern

Internal Time (HHMMSS)

12:34:56

HH:MM:SS

123456

08:30:00 AM

12:MM:SS PM

083000

08:30:00 PM

12:MM:SS PM

203000

20:30:00 AM

24:MM:SS PM

ERROR