Here’s how to use time() functions.
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 configuration information. By default, the configure information will not be displayed in millisecond.
Parameter:
datetimeExp |
Datetime data |
Option:
@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 function:
Description:
Convert a string or integer to time data.
Syntax:
time(stringExp) |
Convert string string into time value according to system-defined datetime format; return null if the conversion fails |
time(stringExp{, format}:loc) |
Convert the string stringExp to time data type according to the format specified by format and return null if the conversion fails. 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 |
Note:
The function converts the string stringExp or integers h,m,s to time data.
Parameter:
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
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 function: