Difference between revisions of "Date/Time Strings"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Date/Time strings are used as arguments in the [[Date and Time Formula Functions]], and can also be returned as the result from those functions.  
Date/Time strings are used as arguments in many of the [[Date and Time Formula Functions]], and can also be returned as the result from those functions.  


'''Examples'''
'''Examples'''
:<tt>'03/27/2009 10:15 am'<br>'20.04.2009 10:45 pm'<br>'2009-20-04 20:30'</tt>
:<tt>'03/27/2009 10:15 am'<br>'20.04.2009 10:45 pm'<br>'2009-20-04 20:30'</tt>
{{Important|<br>To put a date or a time into a Formula, it's best practice to use the [[Date and Time Formula Functions#DATE|DATE]] and [[Date and Time Formula Functions#Time|TIME]] functions. For example: <tt>DATE(2013,3,26)</tt>. Coding a date/time string like <tt>'3/26/2013'</tt> will work for some users, but fail for others if their format differs.}}


Date/Time strings are composed of these elements:
Date/Time strings are composed of these elements:
:{| border="1" cellpadding="5" cellspacing="0"
:{| border="1" cellpadding="5" cellspacing="0"
!Element
!Element
Line 27: Line 28:
:In [[Form]] fields, the string is determined by the user's locale. For example, "vorm." and "nachm." in Germany. But in [[Formula Fields]], the value must be either "am" or "pm".
:In [[Form]] fields, the string is determined by the user's locale. For example, "vorm." and "nachm." in Germany. But in [[Formula Fields]], the value must be either "am" or "pm".
|}
|}
{{Important|When coding a date in a Formula, always use the [[Date and Time Formula Functions#DATE|DATE]] and [[Date and Time Formula Functions#Time|TIME]] functions. For example: <tt>DATE(2013,3,26)</tt>. A date/time string like <tt>'3/26/2013'</tt> will work for some users, but fail for others.}}

Latest revision as of 00:20, 19 October 2013

Date/Time strings are used as arguments in many of the Date and Time Formula Functions, and can also be returned as the result from those functions.

Examples

'03/27/2009 10:15 am'
'20.04.2009 10:45 pm'
'2009-20-04 20:30'

Warn.png

Important:
To put a date or a time into a Formula, it's best practice to use the DATE and TIME functions. For example: DATE(2013,3,26). Coding a date/time string like '3/26/2013' will work for some users, but fail for others if their format differs.

Date/Time strings are composed of these elements:

Element Syntax Description
year yyyy A text string depicting the year (1900 - 9999)
month mm A text string depicting the month (1-12, beginning with January)
day dd A text string depicting the day of the month (1-31, depending on the number of days in the month)
hour hh A text string depicting the hour in the format (0-12 for a 12-hour clock, or 0-24 for a 24-hour clock)
minute mm A text string depicting the minute in the format (0-59)
part of day am
pm
A text string the identifies the part of day for a 12-hour clock.
For more information, see http://en.wikipedia.org/wiki/12-hour_clock
Note:
In Form fields, the string is determined by the user's locale. For example, "vorm." and "nachm." in Germany. But in Formula Fields, the value must be either "am" or "pm".