It looks like you're new here. Sign in or register to get started.
floor(date_diff(Dt_Customer, date_parse_str("2014-06-30", "YYYY-MM-DD","us"), DATE_UNIT_DAY, "America/Newyork"))
This function does not resolve. Gives 'unable to obtain ZonedDatetime for TemporalAccess'
thank you for reaching out to us! This should work:
floor(date_diff(Dt_Customer, date_parse_str("2014-06-30 00:00 America/New_York", "yyyy-MM-dd HH:mm VV","us"), DATE_UNIT_DAY, "America/New_York"))
The problems with the original expression were:
Most valid time zone formats can be found here:
- you need to use yyyy instead of YYYY
- the time and time zone for date_parse_str were missing
- the parser expects "America/New_York" instead of "America/Newyork"
Some additional ones like, for example, "CET" are also allowed.
We understand that it is inconvenient that you now have to specify the time and time zone and we are investigating how we can improve the user experience in that regard. Most likely, we will have a default time of 00:00:00.000000000 if no time is specified. Unfortunately, we will probably have to keep the time zone requirement, though. This assures that your process produces the same results regardless of you physical location.
Sorry for the inconvenience! Have a nice day!