[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'EditBtn' (#lcl)

# TTimeEdit.ValidTimeFormat

Indicates whether the specified value is a valid time format for the TTimeEdit control.

## Declaration

Source position: editbtn.pas line 766

`public function TTimeEdit.ValidTimeFormat(`
`AFormat: string`
`):Boolean;`

## Arguments

`AFormat` |  | Time format examined in the method.

## Function result

Returns True if the specified time format is valid for the control.

## Description

TTimeEdit requires a time format string that does not include date or interval parts which are not used/allowed in the class instance. ValidTimeFormat examines the characters in AFormat to determine which parts are used.

The return value is False if AFormat contains any format specifier(s) or combination of specifier(s) which are not allowed in the control.

The return value is True if AFormat is a valid time format setting for use in the TimeFormat property.

ValidTimeFormat is called when a new value is assigned to the TimeFormat property, and prevents updates to both TimeFormat and Time if the method returns False.

See TimeFormat for more information about the available format specifiers and their usage.

Use TimeSeparator to specify the separator character used to delimit time parts in the formatted Text.

## Version info

Added in LCL version 4.0.

## See also

TTimeEdit.TimeFormat |  | Specifies the time format used to generate the display Text for the time edit control.
TTimeEdit.TimeSeparator |  | Specifies the separator character used to delimit time parts in the format settings applied to the control.
TTimeEdit.Time |  | Represents the time value in the control.
FormatDateTime
FormatChars