time()

Read(253) Label: time,

Here’s how to use time() function.

time( datetimeExp )

Description:

Get the time part from the datetime value.

Syntax:  

time(datetimeExp)

Note:  

The function gets the time part from the datetime value datetimeExp. The result is accurate to millisecond by default. The format must be consistent with the time format in the configure information. By default, the configure information will not be displayed in millisecond.

Parameters:  

datetimeExp

Datetime data

Options:

@m

Accurate to minute

@s

Accurate to second

Return value:

Time value

Example:

time(now())

16:28:26400

time@s(now())

16:28:260

time@m(now())

16:28:000

Related functions:

date()

date(datetimeExp)

datetime(datetimeExp)

datetime()

time()

time()

Description:

Convert the string or integer to time data.

Syntax:

time(stringExp{, format })

Convert the string stringExp to time data type according to the format specified by format. If there is no parameter format, format of stringExp must be in consistent with the time format in the configuration information

time(h,m,s)

Convert h,m,s of integer type to time data type

Note:

The function converts the string stringExp or integers h,m,s to time data.

Parameters:

stringExp

A string

format

A string specifying data format

h

Integer

m

Integer

s

Integer

Return value:

Time data

Example:

time("00:00:45")

00:00:45

time("00/00/45","hh/mm/ss")

00:00:45

time(12,13,00)

12:13:00

Related functions:

datetime()

date()

date(datetimeExp)

datetime(datetimeExp)

time(datetimeExp)