Changes

Jump to navigation Jump to search

StringToDateTime

53 bytes added, 05:28, 3 April 2013
m
Removed dead links
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>StringToDateTime("MM/dd/yy hh:mm:ss tt")</syntaxhighlight>
<syntaxhighlight>StringToDateTime("MM/dd/yyyy hh:mm:ss tt")</syntaxhighlight>
Where: [[MM]] - month*
[[:'''MM''' - month*:'''dd]] ''' - day of the month* [[:'''yy]] ''' - a two-digit year [[:'''yyyy]] ''' - a four-digit year [[:'''hh]] ''' - hours [[:'''mm]] ''' - minutes [[:'''ss]] ''' - seconds [[:'''tt]] ''' - AM/PM designator
==== Notes ==== [[*]] <nowiki>*</nowiki>: Described usage and examples are for the default US regional date and time formats. If the default UK regional format is selected, the dates will be in [['''dd/MM/yy]] ''' and [['''dd/MM/yyyy]] ''' format instead. Date and time formats are controlled by the Regional Options settings that can be accessed from the Control Panel of the Windows XP operating system. ==== Example ====<syntaxhighlight>StringToDateTime("01/01/2008 08:00:00 AM") will return a value of 39448.33333333, corresponding to 08:00:00 AM on January 1st, 2008  StringToDateTime("04/04/99 04:48:00 PM") will return a value of 36254.70000000, corresponding to 04:48:00 PM on April 4th, 1999</syntaxhighlight> 
== Example ==
<syntaxhighlight>StringToDateTime("01/01/2008 08:00:00 AM")</syntaxhighlight>
Will return a value of 39448.33333333, corresponding to 08:00:00 AM on January 1st, 2008.
<syntaxhighlight>StringToDateTime("04/04/99 04:48:00 PM")</syntaxhighlight>
Will return a value of 36254.70000000, corresponding to 04:48:00 PM on April 4th, 1999.
[[Category:Date and Time Routines]]

Navigation menu