- strftime()
It takes two arguments: strftime(format, column)
SELECT timestamp,
strftime('%H', timestamp)
FROM hacker_news
GROUP BY 1
LIMIT 20;
This returns the hour, HH, of the timestamp column!
For strftime(__, timestamp):
%Yreturns the year (YYYY)%mreturns the month (01-12)%dreturns the day of the month (1-31)%Hreturns 24-hour clock (00-23)%Mreturns the minute (00-59)%Sreturns the seconds (00-59) iftimestampformat isYYYY-MM-DD HH:MM:SS.