# Update date for a blog post

**URL:** <https://discourse.gohugo.io/t/update-date-for-a-blog-post/8041>\
**Category:** support\
**Created:** [August 20, 2017, 9:19am UTC](https://discourse.gohugo.io/t/update-date-for-a-blog-post/8041 "2017-08-20T09:19:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![al-gohugo](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@al-gohugo](https://discourse.gohugo.io/u/al-gohugo)\
**Post date:** [August 20, 2017, 9:19am UTC](https://discourse.gohugo.io/t/update-date-for-a-blog-post/8041/1 "2017-08-20T09:19:57Z")

</div>

I have wrote a blog article on 23 of January, this is also written in the "date: " front matter.  
Now I have updated the blog post.

When I change the "date: " in the front matter is the original post date gone, isn’t it?

The only solution what I see is to add some kind of ‘Histroy table’ some ware on the blog site.  
Any other ideas or solutions?

---

<div class="post-metadata">

**Author:** ![budparr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/budparr/32/749_2.png) [@budparr](https://discourse.gohugo.io/u/budparr)\
**Post date:** [August 20, 2017, 12:49pm UTC](https://discourse.gohugo.io/t/update-date-for-a-blog-post/8041/2 "2017-08-20T12:49:22Z")

</div>

You might find what you’re looking for in the docs. There are several date-based variables for you to choose from: [https://gohugo.io/variables/page/#page-variables](https://gohugo.io/variables/page/#page-variables)

---

<div class="post-metadata">

**Author:** ![al-gohugo](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@al-gohugo](https://discourse.gohugo.io/u/al-gohugo)\
**Post date:** [August 20, 2017, 2:06pm UTC](https://discourse.gohugo.io/t/update-date-for-a-blog-post/8041/3 "2017-08-20T14:06:28Z")

</div>

thanks.

I have added

```
lastmod: 2017-08-20

```

into the font matter

I have tried the following but none of them works.

```
Last modified: {{ .Page.Date.Lastmod }}
Last modified: {{ .Date.Lastmod }}
Last modified: {{ .Lastmod }}

```

I use netlify.

---

<div class="post-metadata">

**Author:** ![budparr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/budparr/32/749_2.png) [@budparr](https://discourse.gohugo.io/u/budparr)\
**Post date:** [August 20, 2017, 3:27pm UTC](https://discourse.gohugo.io/t/update-date-for-a-blog-post/8041/4 "2017-08-20T15:27:21Z")

</div>

That last one should work for sure. I can’t say much without seeing your templates.

---

<div class="post-metadata">

**Author:** ![al-gohugo](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@al-gohugo](https://discourse.gohugo.io/u/al-gohugo)\
**Post date:** [August 20, 2017, 4:17pm UTC](https://discourse.gohugo.io/t/update-date-for-a-blog-post/8041/5 "2017-08-20T16:17:01Z")

</div>

Ah okay maybe that’s the problem. I use this in a content file.

Is this possible there?

---

<div class="post-metadata">

**Author:** ![rdwatters](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rdwatters/32/2848_2.png) [@rdwatters](https://discourse.gohugo.io/u/rdwatters)\
**Post date:** [August 20, 2017, 4:45pm UTC](https://discourse.gohugo.io/t/update-date-for-a-blog-post/8041/6 "2017-08-20T16:45:32Z")

</div>

You can’t have spaces in front matter keys:

`lastmod: 2017-08-30`

---

<div class="post-metadata">

**Author:** ![al-gohugo](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@al-gohugo](https://discourse.gohugo.io/u/al-gohugo)\
**Post date:** [August 20, 2017, 4:52pm UTC](https://discourse.gohugo.io/t/update-date-for-a-blog-post/8041/7 "2017-08-20T16:52:51Z")

</div>

Thanks.

It’s now solved with a shortcode.

layouts/shortcodes/lastmod.html

```
{{ dateFormat ( or $.Site.Params.dateFormat "2006, Jan 02" ) $.Page.Params.LastMod }}
```

---

<div class="post-metadata">

**Author:** ![rdwatters](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rdwatters/32/2848_2.png) [@rdwatters](https://discourse.gohugo.io/u/rdwatters)\
**Post date:** [August 20, 2017, 7:46pm UTC](https://discourse.gohugo.io/t/update-date-for-a-blog-post/8041/8 "2017-08-20T19:46:15Z")

</div>

Glad it worked out. I’m still a little confused on your use case, but in the event that I might be on the same page w/r/t to what you’re trying to accomplish, you might want to check out the following:

> **[.Param](https://gohugo.io/functions/param/)**
>
> Calls page or site variables into your template.
