Home > Software design >  Time format is not recognized in snowflake
Time format is not recognized in snowflake

Time:06-27

I have a table field in below format in snowflake. While trying to_date(), to_timestamp() function, its erring out with error message as - Timestamp '8/05/2018 9:03:53 PM' is not recognized.

Format - '8/05/2018 9:03:53 PM'

CodePudding user response:

The format you are using is ambiguous, is it 8th May or August 5th?

Due to the above we don't support that date format.

For more information have a look here

CodePudding user response:

Specify the format in the TO_TIMESTAMP as follows:

to_timestamp('8/05/2018 9:03:53 PM','MM/DD/YYYY HH12:MI:SS AM') -- assumes MM/DD/YYYY

or

to_timestamp('8/05/2018 9:03:53 PM','DD/MM/YYYY HH12:MI:SS AM') -- assumes DD/MM/YYYY

  • Related