DaysToString (Float function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (This one takes positive number only for some reason.)
Line 8: Line 8:
<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><td>A variable to receive the formatted [[Datetime_string_formats|date/time string]] result of the <var>DaysToString</var> method.</td></tr>
<tr><th>float</th><td>A <var>Float</var> value representing days since 1900.</td></tr>
<tr><th>float</th><td>A <var>Float</var> value representing days since 1900. Range 0 - 2958463.</td></tr>
<tr><th>format</th><td>A valid [[Datetime_string_formats|date/time string format]].</td></tr>
<tr><th>format</th><td>A valid [[Datetime_string_formats|date/time string format]].</td></tr>
</table>
</table>

Revision as of 21:11, 28 December 2015

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

%stringA variable to receive the formatted date/time string result of the DaysToString method.
floatA Float value representing days since 1900. Range 0 - 2958463.
formatA valid date/time string format.

Usage notes

  • The DaysToString function is available as of Sirius Mods Version 7.8.

Examples

  1. These statements use DaysToString and StringToDays to convert a value in MM/DD/YY format to the Month 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

  2. See also the StringToDays examples.

See also