StringToDate: Difference between revisions
From MultiCharts
no edit summary
(→Notes) |
No edit summary |
||
Line 3: | Line 3: | ||
The integer portion of the DateTime value indicates the number of days that have elapsed since January 1st, 1900, and the fractional portion of the DateTime value indicates the fraction of the day that has passed since midnight. | The integer portion of the DateTime value indicates the number of days that have elapsed since January 1st, 1900, and the fractional portion of the DateTime value indicates the fraction of the day that has passed since midnight. | ||
== Usage == | |||
<syntaxhighlight>StringToDate("MM/dd/yy")</syntaxhighlight> | <syntaxhighlight>StringToDate("MM/dd/yy")</syntaxhighlight> | ||
Line 10: | Line 10: | ||
<syntaxhighlight>StringToDate("MM/dd/yyyy")</syntaxhighlight> | <syntaxhighlight>StringToDate("MM/dd/yyyy")</syntaxhighlight> | ||
Where: | Where: | ||
:'''MM''' - month* | |||
:'''dd''' - day of the month* | |||
:'''yy''' - a two-digit year | |||
:'''yyyy''' - a four-digit year | |||
=== Notes === | |||
'''*''': Described usage and examples are for the default US regional date format. If the default UK regional format is selected, the dates will be in '''dd/MM/yy''' and '''dd/MM/yyyy''' format instead. Date format is controlled by the Regional Options settings that can be accessed from the Control Panel of the Windows XP operating system. | |||
== Example == | |||
<syntaxhighlight>StringToDate("01/01/2008");</syntaxhighlight> | |||
Will return a value of 39448.00000000, corresponding to the specified date of January 1st, 2008. | |||
<syntaxhighlight>StringToDate("04/04/99");</syntaxhighlight> | |||
Will return a value of 36254.00000000, corresponding to the specified date of April 4th, 1999. | |||
[[Category:Date and Time Routines]] | [[Category:Date and Time Routines]] |