When you create an import task, you must specify a format for the time field. This topic describes the syntax of time formats and provides examples of time formats.

Time format syntax

Character Description Example
G Era designator AD
y Year 2001
M Month July or 07
d Day 10
h Hour in AM or PM (1 to 12) 12
H Hour in day (0 to 23) 22
m Minute 30
s Second 55
S Millisecond 234
E Week Tuesday
D Day in year 360
F Day of week in month 2
w Week in year 40
W Week in month 1
a AM or PM PM
k Hour in day (1 to 24) 24
k Hour in AM or PM (0 to 11) 10
z Time zone Eastern Standard Time
' Delimiter Delimiter
" Single quotation marks "

Time format examples

Date format Parsing syntax Parsed value (unit: seconds)
2020-05-02 17:30:30 yyyy-MM-dd HH:mm:ss 1588411830
2020-05-02 17:30:30:123 yyyy-MM-dd HH:mm:ss:SSS 1588411830
2020-05-02 17:30 yyyy-MM-dd HH:mm 1588411800
2020-05-02 17 yyyy-MM-dd HH 1588410000
20-05-02 17:30:30 yy-MM-dd HH:mm:ss 1588411830
2020-05-02T17:30:30Z yyyy-MM-dd'T'HH:mm:ss'Z' 1588411830
Sat May 02 17:30:30 CST 2020 EEE MMM dd HH:mm:ss zzz yyyy 1588411830