Date Masks

Each ExtraView user has the capability to set their date and time format. The date and time formats determine how dates and times are displayed in output text or html and how they are parsed when entered by the user. The user can select his date and time format on the Personal Options screen. Either one of the inbuilt formats can be selected, or the user can set the Date Format to the value of Custom Date Mask and then provide their own mask in the field labeled Date Mask.

Localizable Date and Time Formats

Dates and times are represented differently around the world. An ExtraView user may choose one of the date/time formats that are sensitive to the specific locale they are using. The following date and time formats will be represented differently dependent on the user’s current locale setting (example of English/US locale representation is given in parentheses):

  • Short without time (12/30/02)
  • Medium without time (Dec 30, 2002)
  • Long without time (December 30, 2002)
  • Full without time (Monday December 30, 2002)
  • Short with time (12/30/02 1:15 PM)
  • Medium with time ((Dec 30, 2002 1:15 PM)
  • Long with time (December 30, 2002 1:15 PM)
  • Full with time (Monday December 30, 2002 1:15 PM)
  • Standard Date / Time Parsing Formats

Certain date and time formats are built in to ExtraView as patterns to be used for parsing dates. If a date is entered in one of the standard formats, it will be parsed without any errors. Use of a custom date mask extends the possible date/time entry formats to include the custom mask pattern. The following are the standardized date/time parsing formats:

Format Example
MM/dd/yy 04/21/03
dd/MM/yy 21/04/03
MM/dd/yyyy 04/21/2003
dd/MM/yyyy 21/04/2003
dd-MMM-yy 21-April-03
dd-MMM-yyyy 21-April-2003
yyyy/MM/dd HH:mm:ss z 2003/04/21 10:23:34 PST
yyyy/MM/dd HH:mm:ss 2003/04/21 10:23:34
yyyy/MM/dd 2003/04/21
yyyy-MM-dd HH:mm:ss 2003-04-21 10:23:34
yyyy MM dd HH:mm:ss 2003 04 21 10:23:34
MM-dd-yyyy HH:mm 04-21-2003 10:23
yyyy-MM-dd 2003-04-21
MM/dd/yy HH:mm 04/21/03 10:23
MM/dd/yy HH 04/21/03 10
yy-MM-dd 03-04-21
MMM dd yyyy April 21 2003
MMM dd, yyyy April 21, 2003
MMM. dd yyyy Apr. 21 2003
MMM. dd, yyyy Apr. 21, 2003

Custom Date Masks

A custom date mask provides the ExtraView user with the maximum of flexibility, but the representation of dates and times using a custom date mask are formatted similarly regardless of the user’s current locale setting. Text strings such as month names or days of week within the representation are locale-sensitive.

Entry of date values into forms can use one of the ExtraView standard date formats or whatever format the user has defined using a custom date mask.

Custom date masks consist of a sequence of characters consisting of punctuation or pattern letters that are chosen from the following:

Letter Date or Time Component Presentation Example
G Era designator Text AD
y Year Year 1996; 96
M Month in year Month July; Jul; 07
w Week in year Number 27
W Week in month Number 2
D Day in month Number 10
d Day of week in month Number 2
E Day in week Text Tuesday; Tue
a Am/pm marker Text PM
H Hour in day (0-23) Number 0
k Hour in day (1-24) Number 24
K Hour in am/pm (0-11) Number 0
h Hour in am/pm (1-12) Number 12
m Minute in hour Number 30
s Second in minute Number 55
S Millisecond Number 978
z Time zone General time zone Pacific Standard Time; PST; GMT-08:00
Z Time zone RFC 822 time zone -0800

Pattern letters are usually repeated, as their number determines the exact presentation:

Text: For formatting, if the number of pattern letters is 4 or more, the full form is used; otherwise a short or abbreviated form is used if available. For parsing, both forms are accepted, independent of the number of pattern letters.

Number: For formatting, the number of pattern letters is the minimum number of digits, and shorter numbers are zero-padded to this amount. For parsing, the number of pattern letters is ignored unless it's needed to separate two adjacent fields.

Year: For formatting, if the number of pattern letters is 2, the year is truncated to 2 digits; otherwise it is interpreted as a number. For parsing, if the number of pattern letters is more than 2, the year is interpreted literally, regardless of the number of digits. So using the pattern "MM/dd/yyyy", "01/11/12" parses to Jan 11, 12 A.D.

For parsing with the abbreviated year pattern ("y" or "yy"), ExtraView must interpret the abbreviated year relative to some century. It does this by adjusting dates to be within 80 years before and 20 years after the time the date is generated. For example, using a pattern of "MM/dd/yy" and a date presented on Jan 1, 1997, the string "01/11/12" would be interpreted as Jan 11, 2012 while the string "05/04/64" would be interpreted as May 4, 1964. During parsing, only strings consisting of exactly two digits will be parsed into the default century. Any other numeric string, such as a one-digit string, a three or more digit string, or a two-digit string that is not all digits (for example, "-1"), is interpreted literally. So, "01/02/3" or "01/02/003" is parsed, using the same pattern, as Jan 2, 3 AD. Likewise, "01/02/-3" is parsed as Jan 2, 4 BC.

Month: If the number of pattern letters is 3 or more, the month is interpreted as text; otherwise, it is interpreted as a number.

General time zone: Time zones are interpreted as text if they have names. For time zones representing a GMT offset value, the following syntax is used:

GMTOffsetTimeZone:
GMT Sign Hours : Minutes

Sign: one of
-
Hours:
Digit
Digit Digit

Minutes:
Digit Digit

Digit: one of
0 1 2 3 4 5 6 7 8 9

Hours must be between 0 and 23, and Minutes must be between 0 and 59. The format is locale independent and digits must be taken from the Basic Latin block of the Unicode standard.

For parsing, RFC 822 time zones are also accepted.

RFC 822 time zone: For formatting, the RFC 822 4-digit time zone format is used:

RFC822TimeZone:
Sign TwoDigitHours Minutes

TwoDigitHours:
Digit Digit

TwoDigitHours must be between 00 and 23. Other definitions are as for general time zones.

For parsing, general time zones are also accepted.