FORMATTIME function
time
The time to format.
timeFormat
The time format to use when formatting the time. 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. If omitted, TimeFormat.HourMinuteTimeFormat,HourMinute is assumed.
use24HourClock
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
A time formatted as text.
Returns a time as text. FORMATTIME(TIME(15, 30, 0))FORMATTIME(TIME(15; 30; 0)) returns "3:30 PM" if the language of the app is set to US English. (FORMATTIME takes the language of the app into account when converting dates.)
Use FORMATDATE together with FORMATTIME to format both a date and a time. This formula returns the current date and time, joined together with a comma and a space:
This function is specific to Calcapp.
Time format
The second parameter may be set to the desired time format. These are the allowed values:
Time format | US English example |
---|---|
TimeFormat.HourMinute (default)
|
3:30 PM |
TimeFormat.HourMinuteSecond
|
3:30:00 PM |
Related functions and properties
- Use PARSETIME to turn text strings produced by this function back into times.
- Use FORMATDATE to create text strings that can be interpreted by the PARSEDATE function.
- Use PARSEDATE to turn text strings produced by FORMATDATE back into dates.
- Use the FormattedValue property of a date and time field to return its value as a text string, formatted according to the date and time format set for the field.
Examples
Returns "3:30 PM" if the language of the app is set to US English. TimeFormat.HourMinuteTimeFormat,HourMinute is assumed if no second parameter is given.
Returns "3:30 PM" if the language of the app is set to US English.
Returns "15:30" if the language of the app is set to German.
Returns today's date, followed by a comma, a space and the current time.