MILLISECOND
Syntax
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> MILLISECOND[MILLISECOND]:::quoted
MILLISECOND --> End((END))
Purpose
The MILLISECOND SQL function extracts the milliseconds from a date/time.
See also DAY, HOUR, MICROSECOND, MINUTE, MONTH, SECOND and YEAR.
Parameters:
- Input (
datetime): the date/time to extract the milliseconds from.
Returns: the milliseconds as an int32.
Examples
The following example extracts the milliseconds from current system date/time in UTC:
select millisecond(sysdateutc)
-------------------
773
The following example extracts the milliseconds from a fixed date/time:
select millisecond(to_date('2016-12-31T12:34:56.1234567'))
-------------------
123