Capturing dates and time accurately is important because forms and workflows are designed to be used anywhere in the world, streamlining our customer's business processes. This chapter will consolidate information from several other documentation chapters related to working with dates and times in .
...
The Date Format property applies to Date controls and the Date portion of the Date/Time control. The default, recommended format is "Automatic", which is a locale-specific date format. The designer has the option to set a particular date format independent of the locale by using the format field, but this is not recommended. Read this documentation for more information about date controls and internationalization.
Available Date Formats consist of three different separators (dash '-', slash '/', or period '.') and four date display formats (DD/MM/YYYY, MM/DD/YYYY, YYYY/MM/DD, or Mmm/DD/YYYY). European date formatting is supported.
...
- A date typed into a form field will be reformatted to match the selected Date Format
- A date entered into a form field will be translated according to the selected format. For example, if you choose a European format of DD-MM-YYYY and the user enters 10-05-2009, the date value will be translated as May 10, 2009. If you choose a US format of MM-DD-YYY the date value will be translated as October 5, 2009.
- Any of the three separators will be valid for date entry but will be translated to the selected separator. For example, if you choose a format of MM/DD/YYY and the user enters 10-05-2009, the date will display 10/05/2009.
- Dates entered like Feb 3, 2001 will be translated into the specified format.
adjusts dates expressed with a two-digit year to be within 80 years before or 20 years after. For example, using a pattern of "MM/DD/YY" and the current date/time of 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 year 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 isn't all digits, is interpreted literally. So "01/02/3" or "01/02/003" are parsed, using the same pattern, as Jan 2, 3 AD. Likewise, "01/02/-3" is parsed as Jan 2, 4 BC. frevvo will always format as 4 digit years.
Note |
---|
The date will be converted to the standard xsd:date format of yyyy-mm-dd in the submissions XML document. Here is an example: <Order Date>2012-03-06</Order Date>. Refer to Viewing XML Documents for more details. |
Rules can be applied to the Date control in all variations.
Time Format
The Time Format property applies to the Time control type. The default, recommended format is "Automatic", which is a locale-specific time format. The designer has the option to set a particular time format independent of the locale by using the format field, but this is not recommended. Read this documentation for more information about time controls and internationalization.
If you keep the default "Automatic" format, you can enter data into a Time control using any of the formats shown in the table. The Time control will accept and display the values as shown:
The Time Format dropdown provides variations of military and standard time conventions, with either colon or period separators.
...
Note |
---|
The time will be converted to the standard xsd:time format of hh:mm:ss in the submissions XML document. Here is an example: <Order Time>14:00:00</Order Time>. Refer to Viewing XML Documents for more details. |
...
Note |
---|
The local time will be converted to and saved in UTC format and the date will be converted to the standard xsd:datetime format of yyyy-mm-ddThh:mm:ssZ in the submission XML document. Here is an example: <OrderDate>2013-08-12T19:13:00Z</OrderDate>. Refer to Viewing XML Documents for more details. |
...
Control Type: | Date/Time | Date | Time |
---|---|---|---|
Functions | frevvo.currentDateTime() now() | frevvo.currentDate() today() | frevvo.currentTime() timeofday() |
frevvo DOES know the browser time zone
| Resolves to current time in UTC (Date/Time always stores value in UTC)
Displays in User's browser time zone. A user in New York sees:
| Resolves to current date in User's browser time zone. For a user in New York:
Displays in User's browser time zone (e.g. New York).
| Resolves to current time in User's browser time zone For a user in New York:
Displays in User's browser time zone (e.g. New York).
|
Using the _formTz URL Parameter to define time zone e.g. _formTz=America/New_York | Resolves to current time in UTC
Displays in EST regardless of browser time zone
| Resolves to current date in EST
Displays in EST
| Resolves to current time in EST
Displays in EST
|
frevvo does NOT know the browser time zone
| Resolves to current time in UTC
Displays in user's browser time zone, e.g. EST
| Resolves to current date in UTC
Displays in UTC
| Resolves to current time in UTC
Displays in UTC
|
Correct Date and Time Formatting in Rules
...
If these methods are used in rules, the designer will see a message in the Debug Console urging that the methods listed above be used instead.
Note | ||
---|---|---|
| ||
Date and Time functions run in the context of a time zone. However, if your rules run before the form infers the browser time zone (on initialization and outside of a Space/Task List), these functions will return the server time in UTC. You should consider whether to add the _formTz parameter to specify the time zone where the rules should run. See the Time Zones and Business Rules documentation for more details. |
...