XFA Specification
Chapter 23, FormCalc Specification
FormCalc Support for Locale
830
default. The time format styles may be defined in the localeSet element, described in
“The localeSet
Element” on page 149.
In much the same way that date format styles are governed by an ISO standards body, so are time formats.
Again, each nation gets to specify the form of its default, short, medium, long, and full time formats. The
locale is responsible for identifying the format of times that conform to the standards of that nation.
The default time format tends to coincide with the medium time format.
Time Picture Clauses
Specifically, in the default en_US locale, the
default time picture clause
is the following:
h:MM:SS A
Just as with a date format styles, a
time picture clause
is a shorthand specification to format a time. It
consists of punctuations, literals, and pattern symbols, e.g., "HH:MM:SS" is a time picture clause.
For a specification of how to construct time picture clauses, refer to
“Time Pictures” on page 921
“Picture Clause Specification”.
Examples of time picture clauses include the following:
h:MM A
HH:MM:SS
HH:MM:SS 'o''clock' A Z
Any time picture clause containing incorrectly specified picture clause symbols, e.g., HHH are invalid.
When parsing, time picture clauses with multiple instances of the same pattern symbols, e.g., HH:MM:HH
are invalid, as are time picture clauses with conflicting pattern symbols, e.g., h:HH:MM:SS. Time picture
clauses with adjacent one letter pattern symbols, e.g., HMS, are inherently ambiguous and should be
avoided.
Localized Time Formats
As with localized date formats, properly internationalized e-forms prompt the user with characters
appropriate for the locale. Such localized prompts specify the format in which the user must supply the
time, a format which must correspond to the picture clause used for input parsing.
Date and Time Values
To do basic arithmetic on dates and times, we introduce the concept of date values and time values. Both
of these are of numeric type, but their actual numeric value is implementation defined and thus
meaningless in any context other than a date or time function. In other words, a form calculation obtains a
date value from a date function, performs some arithmetic on that date value, and only passes that value
to another date function. These same rules apply to time values.
Both date values and time values have an associated origin or
epoch
— a moment in time when things
began. Any date value prior to its epoch is invalid, as is, any time value prior to its epoch.
The unit of value for all date function is the number of days since the epoch. The unit of value for all time
functions is the number of milliseconds since the epoch.