You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using slim-sprig in as part of a go-task/task Taskfile. The end goal is to be able to parse a a git commit timestamp into a particular UTC format. I'm working with various versions of git so I can't rely on the commit timestamp formatting built into git. I also have a hard constraint on the final format being in UTC.
Problem:
From what I can tell all date formatting functions in the slim-sprig library (ie dateInZone) hard codes the local timezone. This means there is no way to run time.Time.Format using the UTC timezone.
Solution:
If my problem stated above is correct (I may be missing something in how to accomplish the desire goal so please let me know if I missed something), I'd like to propose a method to format a date in a given timezone (or just support UTC). This could be exposing the dateInZone function or a new dateInUTC or something else.
I'm happy to submit a PR, but I'd like to get feedback on the agreed upon problem and solution.
Thanks
The text was updated successfully, but these errors were encountered:
Just a FYI in case you find out another function is really needed. In that case, I think adding the function directly on the Task repo for now would possibly be the best option.
Context:
I'm using slim-sprig in as part of a
go-task/task
Taskfile. The end goal is to be able to parse a a git commit timestamp into a particular UTC format. I'm working with various versions ofgit
so I can't rely on the commit timestamp formatting built into git. I also have a hard constraint on the final format being in UTC.Problem:
From what I can tell all date formatting functions in the slim-sprig library (ie
dateInZone
) hard codes the local timezone. This means there is no way to runtime.Time.Format
using the UTC timezone.Solution:
If my problem stated above is correct (I may be missing something in how to accomplish the desire goal so please let me know if I missed something), I'd like to propose a method to format a date in a given timezone (or just support UTC). This could be exposing the
dateInZone
function or a newdateInUTC
or something else.I'm happy to submit a PR, but I'd like to get feedback on the agreed upon problem and solution.
Thanks
The text was updated successfully, but these errors were encountered: