TimeStringConvert (String function): Difference between revisions
Jump to navigation
Jump to search
m (→Examples) |
m (→See also) |
||
Line 34: | Line 34: | ||
==See also== | ==See also== | ||
<ul> | |||
<li><var>[[DaysToString (Float_function)|DaysToString]]</var> | |||
<li><var>[[MillisecondsToString (Float_function)|MillisecondsToString ]]</var> | |||
<li><var>[[SecondsToString (Float_function)|SecondsToString]]</var> | |||
<li><var>[[StringToDays (String_function)|StringToDays]]</var> | |||
<li><var>[[StringToMilliseconds (String_function)|StringToMilliseconds]]</var> | |||
<li><var>[[StringToSeconds (String_function)|StringToSeconds]]</var> | |||
</ul> | |||
{{Template:String:TimeStringConvert footer}} | {{Template:String:TimeStringConvert footer}} |
Revision as of 16:05, 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
YYYYMMDDHHMISSXXX
format to theMonth DAY, YYYY HH:MI:SS.XXX
format:printText {~='20110520173648965':timeStringConvert('YYYYMMDDHHMISSXXX', 'Month DAY, YYYY HH:MI:SS.XXX')}
The result is:
'20110520173648965':timeStringConvert('YYYYMMDDHHMISSXXX', 'Month DAY, YYYY HH:MI:SS.XXX')=May 20, 2011 17:36:48.965
- This statement converts a value in
MM/DD/YY
format to theMonth DAY, YYYY
format:printText {~='12/22/11':timeStringConvert('MM/DD/YY', 'Month DAY, YYYY', centspan=1910)}
The result is:
'12/22/11':timeStringConvert('MM/DD/YY', 'Month DAY, YYYY', centspan=1910)=December 22, 1911
See also