TimeStringConvert (String function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
Line 16: Line 16:
<td>This [[Notation conventions for methods#Named parameters|name allowed]] parameter is the <var>[[Datetime string formats#CENTSPAN|CENTSPAN]]</var> value used, if the <var class="term">format</var> has a two-digit year. The default is specified by the <var class="camel">[[CENTSPAN parameter|CENTSPAN parameter]]</var>. </td></tr>
<td>This [[Notation conventions for methods#Named parameters|name allowed]] parameter is the <var>[[Datetime string formats#CENTSPAN|CENTSPAN]]</var> value used, if the <var class="term">format</var> has a two-digit year. The default is specified by the <var class="camel">[[CENTSPAN parameter|CENTSPAN parameter]]</var>. </td></tr>
</table>
</table>
==Usage notes==


==Examples==
==Examples==

Revision as of 15:08, 3 April 2012

Convert date/time string from one format to another (String class)

[Introduced in Sirius Mods 7.9]


Syntax

%outString = string:TimeStringConvert( inputFormat, outputFormat, - [[CentSpan=] number]) Throws InvalidDateString

Syntax terms

%outString This string is the method object, string, converted to the format in outputFormat.
string A datetime string.
inputFormat The datetime format of the method object string.
outputFormat A string that is the format to which the method object is to be converted.
CentSpan This name allowed parameter is the CENTSPAN value used, if the format has a two-digit year. The default is specified by the CENTSPAN parameter.

Examples

This statement converts a value in YYYYMMDDHHMISSIIIIII format to the HH:MI:SS Mon DD, YYYY format:

%result = (%timestamp):timeStringConvert('YYYYMMDDHHMISSIIIIII', 'HH:MI:SS Mon DD, YYYY')

See also