How to parse/convert duration in the PnDTnHnMn.nS format to the Snowflake interval? Or to at least to Unix Epoch numeric value?
I need that to add such values to the Time/DateTime values.
I'm thinking about something straightforward to at least parse "easy" values like "PT7H30M":
with sample_data as (select 'PT-12H15M' as val)
select
val,
case
when position('H' in val) != 0 then
substr(val, position('T' in val) + 1, position('H' in val) - position('T' in val) - 1)
end as hours
from sample_data
But I'm thinking maybe there is some more elegant way to do that (some regexp for example).