+1 888 340 6572

StringToTime

From MultiCharts

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

StringToTime("hh:mm:ss tt")

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

StringToTime ("08:00:00 AM")  will return a value of 0.33333333 

StringToTime ("04:48:00 PM")  will return a value of 0.70000000