×

Sign up and get MultiCharts free

Use its powerful simulation mode with data included out of the box. Just fill out the form and start honing your trading skills with a few clicks.

Changes - MultiCharts
Open main menu

Changes

StringToTime

1,183 bytes added, 13:32, 19 January 2012
Created page with "Returns the fractional portion of a double-precision decimal DateTime value, corresponding to the specified time. The time is specified by a string expression "hh:mm:ss tt",..."
Returns the fractional portion of a double-precision decimal DateTime value, corresponding to the specified time.

The time is specified by a string expression "hh:mm:ss tt", where hh is the hours in the 12-hour AM/PM format, mm is the minutes, ss is the seconds, and tt is the AM/PM designator.

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>StringToTime("hh:mm:ss tt")</syntaxhighlight>

Where: [[hh]] - hours in the 12-hour AM/PM format

[[mm]] - minutes

[[ss]] - seconds

[[tt]] - AM/PM designator

==== Notes ====
Described usage and examples are for the default US regional time format. Time format is controlled by the Regional Options settings that can be accessed from the Control Panel of the Windows XP operating system.

==== Example ====
<syntaxhighlight>StringToTime ("08:00:00 AM") will return a value of 0.33333333

StringToTime ("04:48:00 PM") will return a value of 0.70000000</syntaxhighlight>



[[Category:Date and Time Routines]]
Anonymous user