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

toDate produces wrong date? #334

Open
Steelhammer11 opened this issue Feb 1, 2024 · 1 comment
Open

toDate produces wrong date? #334

Steelhammer11 opened this issue Feb 1, 2024 · 1 comment

Comments

@Steelhammer11
Copy link

Steelhammer11 commented Feb 1, 2024

I used the following code, to get the timestamp (seconds since the unix epoch) for a certain UTC date:

{{- $creationTimeAsDateObject := toDate "2006-01-02T15:04:05Z" "2024-01-30T13:06:59Z" }}
creationTimeAsDateObject: {{ $creationTimeAsDateObject }}
{{- $timestamp := $creationTimeAsDateObject | unixEpoch }}
timestamp: {{ $timestamp }}

It gave this output:

creationTimeAsDateObject: 2024-01-30 13:06:59 +0100 CET
timestamp: 1706616419

When I checked the timestamp using https://www.epochconverter.com/ it showed that:

"2024-01-30T13:06:59Z" is 1706620019
"2024-01-30 13:06:59 +0100 CET" is 1706616419

I.e. the "toDate" generated a date that was one hour off compared to the UTC date being passed in.
I.e. "2024-01-30T13:06:59Z" is NOT equal to "2024-01-30 13:06:59 +0100 CET"

I'm on Helm version:
version.BuildInfo{Version:"v3.13.1", GitCommit:"3547a4b5bf5edb5478ce352e18858d8a552a4110", GitTreeState:"clean", GoVersion:"go1.20.8"}

@gjenkins8
Copy link
Contributor

Issues regarding Helm usage are best posted over on the helm software repo https://github.com/helm/helm. Please repost there. Thanks!

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

2 participants