HiveBrain v1.2.0
Get Started
← Back to all entries
snippetMinor

In Snowflake, how do I CAST CURRENT_TIMESTAMP up to the minute only?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
thesnowflakecasthowcurrent_timestamponlyminute

Problem

In Snowflake, how do I CAST CURRENT_TIMESTAMP up to the minute only. I don't want seconds, milliseconds, or timezone included in my result.

Solution

You can use TO_CHAR or TO_VARCHAR.

Query,

select to_char(current_timestamp(), 'YYYY-MM-DD HH24:MI') as new_dt;

Code Snippets

select to_char(current_timestamp(), 'YYYY-MM-DD HH24:MI') as new_dt;

Context

StackExchange Database Administrators Q#326784, answer score: 3

Revisions (0)

No revisions yet.