I have a timestamp value in a varchar column. the value looks like below.
2020-10-31T23:36:03.000+0000
I want to convert this to below for using it in my query filter.
2020-10-31
I tried using date_parse and split_part:
SELECT date_parse('2020-06-30T17:17:35.000+0000','%Y-%m-%d %H:%i:%s:%f') as xy
and
where cast(split_part('2020-06-30T17:17:35.000+0000', ' ', 1) as date) >= date '2020-06-30'
Both return error saying:
presto error: Invalid format: "2020-06-30T17:17:35.000+0000" is malformed at "T17:17:35.000+0000"
Can someone point me in the right direction?
Using this solved my problem
cast(from_iso8601_timestamp('2020-06-30T17:17:35.000+0000') as DATE) >= date '2020-06-30'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With