Hour (24-hour clock) as a zero-padded decimal number.
15
%M
Minute as a zero-padded decimal number.
04
%S
Second as a zero-padded decimal number.
04
%b
Month as abbreviated name.
Jan
%B
Month as full name.
January
%a
Weekday as abbreviated name.
Mon
%A
Weekday as full name.
Monday
%w
Weekday as a decimal number, where 0 is Sunday and 6 is Saturday.
1
%y
Year without century as a zero-padded decimal number.
06
%I
Hour (12-hour clock) as a zero-padded decimal number.
03
%p
Locale’s equivalent of either AM or PM.
PM
%z
UTC offset in the form ±HHMM[SS[.ffffff]]
-0700
%Z
Time zone name
MST
%j
Day of the year as a zero-padded decimal number.
002
%U
Week number of the year (Sunday as the first day of the week) as a zero-padded decimal number. All days in a new year preceding the first Sunday are considered to be in week 0.
01
%W
Week number of the year (Monday as the first day of the week) as a zero-padded decimal number. All days in a new year preceding the first Monday are considered to be in week 0.
01
%c
Locale’s appropriate date and time representation.
Mon Jan 02 15:04:05 2006
%x
Locale’s appropriate date representation.
01/02/06
%X
Locale’s appropriate time representation.
15:04:05
%%
A literal ‘%’ character.
%
%f
Microsecond as a decimal number, zero-padded to 6 digits.
999999
Returns
Data type
Value
timestamp
Returns timestamp in RFC3339 format and no timezone specified.
Examples
ParseTimesStamp
createtabledemo(_idid,tsstring);insertintodemo(_id,ts)values(1,'2023-01-02');insertintodemo(_id,ts)values(2,'2023-jan-02-02-23-34');insertintodemo(_id,ts)values(3,'Mon May 02 15:04:05 2022');insertintodemo(_id,ts)values(4,'05/02/22');insertintodemo(_id,ts)values(5,'15:30:45');select_id,tsfromdemo;_id|ts-----+-------------------------------1|2023-01-022|2023-jan-02-02-23-343|MonMay0215:04:0520224|05/02/225|15:30:45