# \`.Params.date\` is no longer null when not specified

**URL:** <https://discourse.gohugo.io/t/params-date-is-no-longer-null-when-not-specified/10536>\
**Category:** dev\
**Created:** [February 14, 2018, 7:59am UTC](https://discourse.gohugo.io/t/params-date-is-no-longer-null-when-not-specified/10536 "2018-02-14T07:59:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheOrangeOne](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/theorangeone/32/3161_2.png) [@TheOrangeOne](https://discourse.gohugo.io/u/TheOrangeOne)\
**Post date:** [February 14, 2018, 7:59am UTC](https://discourse.gohugo.io/t/params-date-is-no-longer-null-when-not-specified/10536/1 "2018-02-14T07:59:02Z")

</div>

In Hugo 0.34, if a page didn’t specify `date` in its frontmatter, `.Params.date` would be `nil`, which is great for checking if content has a date, and so not showing one. In Hugo \>0.35, `.Params.date` is always set to something, even if it’s the base date (0 in unix epoch), which is truethy, and so shows a date on a lot of content which doesn’t specify one.

I’m fairly sure I’ve found the issue: [https://github.com/gohugoio/hugo/blob/34ba97ce86f30552db40e06b36451c7a801fe149/hugolib/page.go#L1357.Sets](https://github.com/gohugoio/hugo/blob/34ba97ce86f30552db40e06b36451c7a801fe149/hugolib/page.go#L1357.Sets). ([https://github.com/gohugoio/hugo/pull/4322](https://github.com/gohugoio/hugo/pull/4322)) No matter what frontmatter was specified, `date` is injected into the frontmatter with a valid date. I’m not exactly sure what the right solution is.

Working out which dates to show in a logical manner is very difficult. If no date is specified, no date (or related fields) should be set, unless `useModTimeAsFallback` is set in config. To me, I think the right solution here is to not mutate the frontmatter, leave that as-is, defined or otherwise, and just edit `.Date`. However, i’m not sure if the same should go for the other date keys (`lastmod` etc)?

I think I have the knowledge to make the desired changes, but opening up here to get other’s opinions before I make the changes.

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [February 14, 2018, 8:09am UTC](https://discourse.gohugo.io/t/params-date-is-no-longer-null-when-not-specified/10536/3 "2018-02-14T08:09:08Z")

</div>

I would suggest you

1. Use the `Date` on page as the truth about date or not.
2. That date can never be nil, but you can do `if not .Date.IsZero`
