# Understanding publishDate

**URL:** <https://discourse.gohugo.io/t/understanding-publishdate/39454>\
**Category:** support\
**Created:** [July 11, 2022, 9:13pm UTC](https://discourse.gohugo.io/t/understanding-publishdate/39454 "2022-07-11T21:13:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![willduncanphoto](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/willduncanphoto/32/11840_2.png) [@willduncanphoto](https://discourse.gohugo.io/u/willduncanphoto)\
**Post date:** [July 11, 2022, 9:13pm UTC](https://discourse.gohugo.io/t/understanding-publishdate/39454/1 "2022-07-11T21:13:02Z")

</div>

I’m just trying to wrap my head around `publishDate` usage and behavior in Hugo. There seems to be a great deal of misunderstanding or assumptions in my searches and the documentation isn’t always the easiest for me to digest.

In my head, `date` is the creation date, and adding `publishDate` is more of an editorial option for pushing content/articles at a specific time/date of your choosing. If no `publishDate` is present, it would fall back and use date. And that `draft = true` \> publishdate \> date.

`hugo server -D -F` is then required to preview draft and future publish items? Or is that a development vs production environment thing?

And you use the `[frontmatter]` in the config to define the inheritance/fallback from the defaults?

---

<div class="post-metadata">

**Author:** ![gaetawoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/gaetawoo/32/16789_2.png) [@gaetawoo](https://discourse.gohugo.io/u/gaetawoo)\
**Post date:** [July 11, 2022, 11:25pm UTC](https://discourse.gohugo.io/t/understanding-publishdate/39454/2 "2022-07-11T23:25:20Z")

</div>

> [@willduncanphoto](#):
>
> There seems to be a great deal of misunderstanding or assumptions in my searches and the documentation isn’t always the easiest for me to digest.

Welcome to Hugo.

> [@willduncanphoto](#):
>
> In my head, `date` is the creation date, and adding `publishDate` is more of an editorial option for pushing content/articles at a specific time/date of your choosing. If no `publishDate` is present, it would fall back and use date.

Accurate

> [@willduncanphoto](#):
>
> And that `draft = true` \> publishdate \> date.

I see what you are trying to express here but it’s not quite right. draft is a true/false flag. publishdate communicates something about your post and also won’t publish until the date is past if you have such build parameters, and date is nothing special. Just a date string which can be used or not used for anything or nothing.

> [@willduncanphoto](#):
>
> `hugo server -D -F` is then required to preview draft and future publish items? Or is that a development vs production environment thing?

These flags can apply to the build or the server.

> [@willduncanphoto](#):
>
> And you use the `[frontmatter]` in the config to define the inheritance/fallback from the defaults?

Yes

---

<div class="post-metadata">

**Author:** ![techmagus](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/techmagus/32/16997_2.png) [@techmagus](https://discourse.gohugo.io/u/techmagus)\
**Post date:** [July 11, 2022, 11:41pm UTC](https://discourse.gohugo.io/t/understanding-publishdate/39454/3 "2022-07-11T23:41:22Z")

</div>

> [@gaetawoo](#):
>
> publishdate communicates something about your post and also won’t publish until the date is past

Quick question, did you mean Hugo will not publish a post even if `date` is earlier than `publishDate`?

---

<div class="post-metadata">

**Author:** ![gaetawoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/gaetawoo/32/16789_2.png) [@gaetawoo](https://discourse.gohugo.io/u/gaetawoo)\
**Post date:** [July 11, 2022, 11:48pm UTC](https://discourse.gohugo.io/t/understanding-publishdate/39454/4 "2022-07-11T23:48:22Z")

</div>

As far as I understand, Hugo checks if the publishDate is past or future based on the date and time of when you tell it to build or serve your site. It has nothing to do with the date: value .

---

<div class="post-metadata">

**Author:** ![gaetawoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/gaetawoo/32/16789_2.png) [@gaetawoo](https://discourse.gohugo.io/u/gaetawoo)\
**Post date:** [July 11, 2022, 11:50pm UTC](https://discourse.gohugo.io/t/understanding-publishdate/39454/6 "2022-07-11T23:50:18Z")

</div>

not super sure what you mean by the last statement, or the implications, but it makes sense that if date: is in the future, and you have no publishDate set, and you build your site without building future, then the PublishDate value waterfalls and gets its value from date:

---

<div class="post-metadata">

**Author:** ![willduncanphoto](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/willduncanphoto/32/11840_2.png) [@willduncanphoto](https://discourse.gohugo.io/u/willduncanphoto)\
**Post date:** [July 12, 2022, 12:00am UTC](https://discourse.gohugo.io/t/understanding-publishdate/39454/7 "2022-07-12T00:00:09Z")

</div>

Thanks.

What I meant with draft, would it overrule content that is passed it’s publish date by default? or the are totally independent of each other unless otherwise built to do so?

---

<div class="post-metadata">

**Author:** ![gaetawoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/gaetawoo/32/16789_2.png) [@gaetawoo](https://discourse.gohugo.io/u/gaetawoo)\
**Post date:** [July 12, 2022, 12:17am UTC](https://discourse.gohugo.io/t/understanding-publishdate/39454/8 "2022-07-12T00:17:42Z")

</div>

Draft will overrule any date-based mechanism
