datetime.formatTime

This function formats the time according to the specified format. The format uses hh(hour), mm(minute), ss(second), and is not case-sensitive.

Syntax

datetime.formatTime(datetime, format)

Arguments

Argument

Type

Description

datetime

datetime

Time that needs to be formatted.

format

string

Format to be used for the time.

Returns

Type

Description

string

Time in the specified format.

Examples

The function datetime.formatTime("10:11:05.00000", "hh-mm-ss") returns 10-11-05.