Compare Time to Determine if Now is Today

With .Date you can easily convert to Unix time for comparison to now (".Date.Unix" “ge” now.Unix), but it looks like you need to convert your field instead of a date parameter, so you could probably do something like {{.Params.sale_end | dateFormat "20060102"}} and use that to compare to now. You’ll have to convert now in whatever date format you choose to match (e.g. {{now.Format "20060102"}}). I think that will work.

2 Likes