time()

Read(286) 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}:loc)

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. Parameter loc is the language used in stringExp; default is the system language.

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

loc

Language name, which is case insensitive. The most commonly used languages are Chinese (zh) and English (en); see A.sort() to know other languages supported in esProc

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

time("1:08 PM","h:mm a":"en")

13:08:00

Related functions:

datetime()

date()

date(datetimeExp)

datetime(datetimeExp)

time(datetimeExp)