DaysToString (Float function): Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (minor formatting) |
||
(11 intermediate revisions by 5 users not shown) | |||
Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
{{Template:Float:DaysToString syntax}} | {{Template:Float:DaysToString syntax}} | ||
===Syntax terms=== | ===Syntax terms=== | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>%string</th><td>A variable to receive the formatted [[Datetime_string_formats|date/time string]] result of the <var>DaysToString</var> method.</td></tr> | <tr><th>%string</th> | ||
<tr><th>float</th><td>A <var>Float</var> value representing days since 1900.</td></tr> | <td>A variable to receive the formatted [[Datetime_string_formats|date/time string]] result of the <var>DaysToString</var> method.</td></tr> | ||
<tr><th>format</th><td>A valid date/time string format</td></tr> | |||
<tr><th>float</th> | |||
<td>A <var>Float</var> value representing days since 1900. It must be in the range 0 to 2958463.</td></tr> | |||
<tr><th>format</th> | |||
<td>A valid [[Datetime string formats|date/time string format]].</td></tr> | |||
</table> | </table> | ||
==Usage notes== | ==Usage notes== | ||
<ul><li>The <var>DaysToString</var> function is available as of <var class="product"> | <ul> | ||
<li>The <var>DaysToString</var> function is available as of <var class="product">Sirius Mods</var> Version 7.8. | |||
</ul> | |||
==Examples== | ==Examples== | ||
<ol> | |||
<li>These statements use <var>DaysToString</var> and <var>[[StringToDays (String_function)|StringToDays]]</var> to convert a value in <code>MM/DD/YY</code> format to the <code>Month DAY, YYYY</code> format. They also show the effect of the <var>CentSpan</var> parameter: | |||
<p class="code">printText {~='12/22/11':stringToDays('MM/DD/YY', centspan=2000):daysToString('Month DAY, YYYY')} | |||
printText {~='12/22/11':stringToDays('MM/DD/YY', centspan=1910):daysToString('Month DAY, YYYY')}</p> | |||
<p> | |||
The results are:</p> | |||
<p class="output">'12/22/11':stringToDays('MM/DD/YY', centspan=2000):daysToString('Month DAY, YYYY')=December 22, 2011 | |||
'12/22/11':stringToDays('MM/DD/YY', centspan=1910):daysToString('Month DAY, YYYY')=December 22, 1911</p> </li> | |||
<li>See also the <var>StringToDays</var> [[StringToDays (String function)#Examples|examples]]. </li> | |||
</ol> | |||
==See also== | ==See also== | ||
<ul> | |||
<li>Related intrinsic methods (provide conversion from one form of date representation to another): | |||
<ul> | |||
<li><var>[[MillisecondsToString (Float_function)|MillisecondsToString ]]</var> </li> | |||
<li><var>[[SecondsToString (Float_function)|SecondsToString]]</var> </li> | |||
<li><var>[[StringToDays (String_function)|StringToDays]]</var> </li> | |||
<li><var>[[StringToMilliseconds (String_function)|StringToMilliseconds]]</var> </li> | |||
<li><var>[[StringToSeconds (String_function)|StringToSeconds]]</var> </li> | |||
<li><var>[[TimeStringConvert (String_function)|TimeStringConvert]]</var> </li> | |||
</ul> </li> | |||
<li>Related <var>System</var> methods: | |||
<ul> | |||
<li><var>[[CurrentTimeMilliseconds (System function)|CurrentTimeMilliseconds]]</var> </li> | |||
<li><var>[[CurrentTimeSeconds (System function)|CurrentTimeSeconds]]</var> </li> | |||
<li><var>[[CurrentTimeDays (System function)|CurrentTimeDays ]]</var> </li> | |||
<li><var>[[CurrentTimeString (System function)|CurrentTimeString ]]</var> </li> | |||
</ul> </li> | |||
</ul> | |||
{{Template:Float:DaysToString footer}} | {{Template:Float:DaysToString footer}} |
Latest revision as of 17:47, 4 January 2016
Convert days since 1900 to string date/time (Float class)
[Introduced in Sirius Mods 7.8]
The DaysToString intrinsic function operates on a Float value representing days since 1900 and returns a formatted string representing that date/time.
Syntax
%string = float:DaysToString( format)
Syntax terms
%string | A variable to receive the formatted date/time string result of the DaysToString method. |
---|---|
float | A Float value representing days since 1900. It must be in the range 0 to 2958463. |
format | A valid date/time string format. |
Usage notes
- The DaysToString function is available as of Sirius Mods Version 7.8.
Examples
- These statements use DaysToString and StringToDays to convert a value in
MM/DD/YY
format to theMonth DAY, YYYY
format. They also show the effect of the CentSpan parameter:printText {~='12/22/11':stringToDays('MM/DD/YY', centspan=2000):daysToString('Month DAY, YYYY')} printText {~='12/22/11':stringToDays('MM/DD/YY', centspan=1910):daysToString('Month DAY, YYYY')}
The results are:
'12/22/11':stringToDays('MM/DD/YY', centspan=2000):daysToString('Month DAY, YYYY')=December 22, 2011 '12/22/11':stringToDays('MM/DD/YY', centspan=1910):daysToString('Month DAY, YYYY')=December 22, 1911
- See also the StringToDays examples.
See also
- Related intrinsic methods (provide conversion from one form of date representation to another):
- Related System methods: