Let’s say we just need the month part of the current timestamp.
STRFTIME is a SQL function that can be used over DATETIME to extract specific information. Look at the example below.
Let’s say we need the current hour. The query would look like this:
Here are a few basic parameters that you can use to extract specific datetime related information.
|%d||day of month: 00|
|%f||fractional seconds: SS.SSS|
|%j||day of year: 001-366|
|%J||Julian day number|
|%s||seconds since 1970-01-01|
|%w||day of week 0-6 with Sunday==0|
|%W||week of year: 00-53|
You can also combine one or more date parameters to get information the way you need it.
Suppose we want the time stamp in format
Look at the query below