Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dateInZone silently fails when it doesn't understand the parameters passed to it #383

Open
CameronGo opened this issue Sep 28, 2023 · 0 comments

Comments

@CameronGo
Copy link

I found myself spinning in circles trying to use dateInZone and getting unexpected results before I realized my docker container did not have the tzdata package installed. My issue is that, rather than returning an error or failing, dateInZone always returns the UTC value of the time object. I further discovered that, if you mistakenly pass a time formatted string to dateInZone, instead of returning an error or failing, it returns the value of (now).

For example, on a system without tzdata, ideally this should return an error, but instead returns the value of now in UTC:
{{- dateInZone "2006-01-02T15:04:05Z07:00" (now) "America/New_York" -}}

Also, ideally this should return an error because it was passed a string instead of a time object, but instead returns the value of (now) in UTC:
{{- dateInZone "2006-01-02T15:04:05Z07:00" "2020-11-23T12:34:31-05:00" "UTC" -}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant