DaysToString (Float function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
Line 16: Line 16:


==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>
The result is:
<p class="output">'20110520':stringToDays('YYYYMMDD'):daysToString('Month DAY, YYYY')=May 20, 2011 </p>
<li>See also the <var>StringToDays</var> [[StringToDays (String function)#Examples|examples]].
</ol>


==See also==
==See also==

Revision as of 21:47, 3 April 2012

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.
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 result is:

    '20110520':stringToDays('YYYYMMDD'):daysToString('Month DAY, YYYY')=May 20, 2011

  2. See also the StringToDays examples.

See also