PARSETIME function

PARSETIME(textualTime, timeFormat, use24HourClock?) PARSETIME(textualTime; timeFormat; use24HourClock?)

textualTime — Text or { Text }

The text string containing a time.

timeFormat — TimeFormat or { TimeFormat }

The time format the given text string uses. Use TimeFormat.HourMinuteTimeFormat,HourMinute for a text string that does not include seconds and TimeFormat.HourMinuteSecondTimeFormat,HourMinuteSecond for a text string that does include seconds.

use24HourClock — Logical or { Logical } (optional)

Whether a 24-hour clock should be used, regardless of the time formatting conventions of the language the app has been configured to use. If omitted, FALSE is assumed.

Returns — Number or { Number }

The time found in the given text string, as a sequential serial number.

Interprets a text string as a time and returns it. PARSETIME("3:30 PM", TimeFormat.HourMinute)PARSETIME("3:30 PM"; TimeFormat,HourMinute) returns a sequential serial number representing 3:30 PM. (The date is set to December 31, 1899.)

PARSETIME takes the language of the app into account when converting text strings to times. When PARSETIME is used with an app whose language is set to German, for instance, text strings representing times should follow German time formatting conventions.

The formula above should be written as follows when the language is set to German:

PARSETIME("15:30", TimeFormat.HourMinute)PARSETIME("15:30"; TimeFormat,HourMinute)

PARSETIME can be instructed to use a 24-hour clock, even if the language of the app normally uses a 12-hour clock, by passing TRUE as the optional third parameter. This formula works even if the language of the app is set to US English:

PARSETIME("15:30", TimeFormat.HourMinute, TRUE)PARSETIME("15:30"; TimeFormat,HourMinute; TRUE)

This function is specific to Calcapp.

Time format

The second parameter must be set to the time format used by the first parameter. These are the allowed values:

Time format US English example
TimeFormat.HourMinute 3:30 PM
TimeFormat.HourMinuteSecond 3:30:00 PM

Related functions

Examples

PARSETIME("3:30 PM", TimeFormat.HourMinute)PARSETIME("3:30 PM"; TimeFormat,HourMinute)

Returns a sequential serial number representing 3:30 PM, if the language of the app is set to US English.

PARSETIME("15:30", TimeFormat.HourMinute)PARSETIME("15:30"; TimeFormat,HourMinute)

Returns a sequential serial number representing 3:30 PM, if the language of the app is set to German.

PARSETIME("15:30", TimeFormat.HourMinute, TRUE)PARSETIME("15:30"; TimeFormat,HourMinute; TRUE)

Returns a sequential serial number representing 3:30 PM, if the language of the app is set to US English. The third parameter instructs PARSETIME to use a 24-hour clock.

PARSETIME("3:30:00 PM", TimeFormat.HourMinuteSecond)PARSETIME("3:30:00 PM"; TimeFormat,HourMinuteSecond)

Returns a sequential serial number representing 3:30:00 PM, if the language of the app is set to US English.

PARSEDATE("11/14/81", DateFormat.Numeric) + PARSETIME("3:30 PM", TimeFormat.HourMinute)PARSEDATE("11/14/81"; DateFormat,Numeric) + PARSETIME("3:30 PM"; TimeFormat,HourMinute)

Returns a sequential serial number representing November 14, 1981, if the language of the app is set to US English. The time is set to 3:30 PM. The integer part of a sequential serial number represents the date and the fractional part represents the time, meaning that adding together a sequential serial number representing a date and a sequential serial number representing a time correctly combines them.