In converting some code from Netezza to Snowflake, I've come across what seems to be a gap in Snowflake.
The format is:
TO_CHAR(<date/time field>,'SSSS')
The parameter SSSS is defined as Seconds past midnight.
Snowflake cannot extract time below the second level, e.g. millisecond, microsecond, nanosecond.
Am I missing something? Other alternatives?
What is interesting is that this question is asking for sub-second timeframes, but making reference to a function that only returns at the seconds-level for Netezza. So, I'm not sure exactly what you are looking for, but this is where you'd go with Snowflake, I believe, using a
current_timestamp()
as an example:This returns time since midnight in seconds.
This returns time since midnight in milliseconds.
One could easily make this into a function, as well, if you wanted to make the call a bit more concise in your code.