convert_date_time
Converts date and time formats using standard IDOL formats. All date and time input is treated as local time unless it contains explicit time zone information.
The InputFormatCSV and OutputFormat arguments specify date and time formats, and accept the following values:
AUTNDATE. The OpenText date format (1 to a maximum of 10 digits). This format covers the epoch range (1 January 1970 to 19 January 2038) to a resolution of one second, and dates between 30 October 1093 BC and 26 October 3058 to a resolution of one minute.-
date formats that you specify using one or more of the following:
YYYear (2 digits). For example, 99, 00, 01 and so on. YYYYYear (4 digits). For example, 1999, 2000, 2001 and so on. #YY+Year (2 or 4 digits). If you provide 2 digits, then it uses the
YYformat. If you provide 4 digits, it uses theYYYYformat.For example, it interprets
07as2007 ADand1007as1007 AD.#YYear (1 to a maximum of 16 digits) and can be followed by ADorBC. An apostrophe (') immediately before the year denotes a truncated year. For example,2008,'97(interpreted as1997),97(interpreted as97 AD),'08(interpreted as2008),2008 ADand200 BC. A truncated year with a BC identifier is invalid ('08 BC).#FULLYEARYear (1 to a maximum of 16 digits). For example 8,98,108,2008, each of which is taken literally. The year is taken relative to the common EPOCH (0AD).#ADBCTime Period. For example,
AD,CE,BC,BCEor any predefined list of EPOCH indicators. Typically, the year specified using the above Year formats is interpreted as un-truncated and relative to the EPOCH. For example, 84 AD is interpreted as 1984 AD and 84 BC is interpreted as 84 BC.The only exception to this is when you use both
#YY+and#ADBC. In this case, the format is interpreted as un-truncated even if the year was set to truncated by#YY+. For example, 99 AD is interpreted as the year 99 AD.OpenText recommends you use only
YY,YYYYor#FULLYEARwith#ADBC.LONGMONTHA long month, for example, January,Februaryand so on.SHORTMONTHA short month, for example, Jan,Feband so on.MMMonth (2 digits). For example, 01,10,12and so on.M+Month (1 or 2 digits). For example, 1,2,3,10and so on.DDDay (2 digits). For example, 01,02,03,12,23and so on.D+Day (1 or 2 digits). For example, 1,2,12,13,31and so on.LONGDAY2 digits with a postfix. For example, 1st,2ndand so on.HHHour (2 digits). For example, 01,12,13and so on.H+Hour (1 or 2 digits). NNMinute (2 digits). N+Minute (1 or 2 digits). SSSecond (2 digits). S+Second (1 or 2 digits). ZZZTime Zone, for example, GMT,EST,PST, and so on.ZZZZZTime Difference (1 to 9 digits). For example, +04 denotes 4 hours ahead of UTC. Other examples include +4, +04, +0400, +0400 MSD (the string MSD is ignored). A further example is +030, in this case the time differences is interpreted as 30 minutes. #PMAM or PM indicator (2 characters). For example, 2001/09/09 02:46:40 pm #SA space
The following table shows some example date and time formats:
| Date and time format string | Example date |
|---|---|
DD/MM/YYYY
|
09/05/2013 |
D+ SHORTMONTH YYYY
|
2 Jan 2001 |
D+ LONGMONTH YYYY HH:NN:SS ZZZZZ
|
17 August 2003 10:41:07 -0400 |
Syntax
convert_date_time( Input, InputFormatCSV, OutputFormat )
Arguments
| Argument | Description |
|---|---|
Input
|
(string) The date and time to convert. |
InputFormatCSV
|
(string) A comma-separated list of the possible date and time formats of the input. |
OutputFormat
|
(string) The format of the date and time to output. |
Returns
(String). A string containing the date and time in the desired format.