Lua Methods Reference > General Methods > convert_date_time

convert_date_time
The convert_date_time method converts date and time formats using standard Autonomy syntax. All date and time input is treated as local time unless it contains explicit time zone information.
You can use the following characters to define date and time formats:
Year (2 or 4 digits). If you provide 2 digits, then it uses the YY format. If you provide 4 digits, it uses the YYYY format.
For example, it interprets 07 as 2007 AD and 1007 as 1007 AD.
Year (1 to a maximum of 16 digits) and can be followed by AD or BC. An apostrophe (') immediately before the year denotes a truncated year. For example, 2008, '97 (interpreted as 1997), 97 (interpreted as 97 AD), '08 (interpreted as 2008), 2008 AD and 200 BC. A truncated year with a BC identifier is invalid ('08 BC).
Year (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).
Time Period. For example, AD, CE, BC, BCE or 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.
Autonomy recommends you use only YY, YYYY or #FULLYEAR with #ADBC.
A long month, for example, January, February and so on.
A short month, for example, Jan, Feb and so on.
Month (2 digits). For example, 01, 10, 12 and so on.
Day (2 digits). For example, 01, 02, 03, 12, 23 and so on.
Day (1 or 2 digits). For example, 1, 2, 12, 13, 31 and so on.
Hour (2 digits). For example, 01, 12, 13 and so on.
Time Zone, for example, GMT, EST, PST, and so on.
Time 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.
The following table shows some example date and time formats:
 
Syntax
convert_date_time( Input, InputFormatCSV, OutputFormat )
Arguments
 
Returns
(String). A string containing the date and time in the desired format.