# \#dateformats

**URL:** https://discourse.gohugo.io/tag/dateformats/5.md

[Latest](https://discourse.gohugo.io/latest.md) · [Categories](https://discourse.gohugo.io/categories.md) · [Tags](https://discourse.gohugo.io/tags.md)

---

## [Is there a way to tell apart different \`.LastMod\` dates](https://discourse.gohugo.io/t/is-there-a-way-to-tell-apart-different-lastmod-dates/57051)

<div class="topic-metadata">

**Author:** [@cmahnke](https://discourse.gohugo.io/u/cmahnke)\
**Replies:** 1\
**Last updated:** [April 26, 2026, 6:11pm UTC](https://discourse.gohugo.io/t/is-there-a-way-to-tell-apart-different-lastmod-dates/57051 "2026-04-26T18:11:31Z")

</div>

Is there a way to check if a .LastMod is set via Frontmatter param (lastmod) or GitInfo? I know I can check against .Date to see if its autogenerated from the post date. Thanks!

---

## [Unable to deploy to github pages with dates & tags on my posts](https://discourse.gohugo.io/t/unable-to-deploy-to-github-pages-with-dates-tags-on-my-posts/54000)

<div class="topic-metadata">

**Author:** [@Kenny](https://discourse.gohugo.io/u/Kenny)\
**Replies:** 3\
**Last updated:** [March 19, 2025, 11:58am UTC](https://discourse.gohugo.io/t/unable-to-deploy-to-github-pages-with-dates-tags-on-my-posts/54000 "2025-03-19T11:58:17Z")

</div>

I keep making changes to my posts because it keeps failing when i try to deploy it! the first few lines of my .MD files are all the same, and they all have the same information except “datePublished”, and title. I’m pret…

---

## [Any way to display date in news feed taken from front matter of the post](https://discourse.gohugo.io/t/any-way-to-display-date-in-news-feed-taken-from-front-matter-of-the-post/49953)

<div class="topic-metadata">

**Author:** [@spacedrone808](https://discourse.gohugo.io/u/spacedrone808)\
**Replies:** 3\
**Last updated:** [May 23, 2024, 7:38am UTC](https://discourse.gohugo.io/t/any-way-to-display-date-in-news-feed-taken-from-front-matter-of-the-post/49953 "2024-05-23T07:38:18Z")

</div>

I tried {{ .Date | time.Format “:date\_medium” }} and {{ .PublishDate }} without any luck. It looks that i’m doing something wrong here. Any suggestions?

---

## [A question about .Date and it's inclusion location](https://discourse.gohugo.io/t/a-question-about-date-and-its-inclusion-location/49938)

<div class="topic-metadata">

**Author:** [@benstraw](https://discourse.gohugo.io/u/benstraw)\
**Replies:** 2\
**Last updated:** [May 22, 2024, 5:50am UTC](https://discourse.gohugo.io/t/a-question-about-date-and-its-inclusion-location/49938 "2024-05-22T05:50:39Z")

</div>

I have enabled 2 places where I am accessing .Date in my template, one in single.html in the \_default partial and the other in a partial called page\_meta.html which is included in my footer. Both case are doing this… {…

---

## [When using :git for lastmod, pages are tagged with a timestamp of Jan 01, 0001](https://discourse.gohugo.io/t/when-using-git-for-lastmod-pages-are-tagged-with-a-timestamp-of-jan-01-0001/47614)

<div class="topic-metadata">

**Author:** [@fdzero](https://discourse.gohugo.io/u/fdzero)\
**Replies:** 7\
**Last updated:** [January 1, 2024, 8:08pm UTC](https://discourse.gohugo.io/t/when-using-git-for-lastmod-pages-are-tagged-with-a-timestamp-of-jan-01-0001/47614 "2024-01-01T20:08:26Z")

</div>

I was able to overcome my last issue that I posted about with success, got everything working, then realized that my categories for blogs, were showing a date stamp of “Jan 01, 0001” even though none of the other posts o…

---

## [Intelligent output of date range](https://discourse.gohugo.io/t/intelligent-output-of-date-range/45393)

<div class="topic-metadata">

**Author:** [@pensivedog](https://discourse.gohugo.io/u/pensivedog)\
**Replies:** 0\
**Last updated:** [July 21, 2023, 4:51pm UTC](https://discourse.gohugo.io/t/intelligent-output-of-date-range/45393 "2023-07-21T16:51:26Z")

</div>

In case it’s helpful to anyone, here’s a partial I made to display a date range accounting for differences in day, month, and year, where start\_date and end\_date are defined in frontmatter. It will display date ranges w…

---

## [Force publish/override single content date](https://discourse.gohugo.io/t/force-publish-override-single-content-date/44486)

<div class="topic-metadata">

**Author:** [@jgarr](https://discourse.gohugo.io/u/jgarr)\
**Replies:** 1\
**Last updated:** [May 23, 2023, 12:07am UTC](https://discourse.gohugo.io/t/force-publish-override-single-content-date/44486 "2023-05-23T00:07:57Z")

</div>

I generate a table of content on my site and I realized today that it’s not publishing pages where conferences are happening in the future because I use the Date parameter to say when the conference will be. Is there a w…

---

## [Using date as a string in RFC3339 format](https://discourse.gohugo.io/t/using-date-as-a-string-in-rfc3339-format/44162)

<div class="topic-metadata">

**Author:** [@donaldjenkins](https://discourse.gohugo.io/u/donaldjenkins)\
**Replies:** 4\
**Last updated:** [May 1, 2023, 3:47pm UTC](https://discourse.gohugo.io/t/using-date-as-a-string-in-rfc3339-format/44162 "2023-05-01T15:47:02Z")

</div>

I need to pass on the Published and Last Modified dates for a page in the JSON syntax(“2018-05-09T20:21:51+01:00”) in the head of each html page (for Schema.org ), with the date represented as a string in RFC3339 format.…

---

## [Converting time variable between timezones](https://discourse.gohugo.io/t/converting-time-variable-between-timezones/41973)

<div class="topic-metadata">

**Author:** [@LawyerDog](https://discourse.gohugo.io/u/LawyerDog)\
**Replies:** 0\
**Last updated:** [December 18, 2022, 3:42am UTC](https://discourse.gohugo.io/t/converting-time-variable-between-timezones/41973 "2022-12-18T03:42:56Z")

</div>

Hey @bep, currently Hugo has no ability to convert the time zone of a time.Time variable, like it is possible in pure Go. This makes it challenging to present the same date in different time zones. The only solution I am…

---

## [Present a date object in different timezones](https://discourse.gohugo.io/t/present-a-date-object-in-different-timezones/41863)

<div class="topic-metadata">

**Author:** [@LawyerDog](https://discourse.gohugo.io/u/LawyerDog)\
**Replies:** 3\
**Last updated:** [December 12, 2022, 4:50pm UTC](https://discourse.gohugo.io/t/present-a-date-object-in-different-timezones/41863 "2022-12-12T16:50:51Z")

</div>

How do I present a date in two different time zones? Basically, I want to recreate the following: package main import ( "fmt" "time" ) const kyivTZ = "Europe/Kyiv" const vancouverTZ = "America/Vancouver" func main…

---

## [Select Pages using \`where\` fails but \`if\` works with date comparison](https://discourse.gohugo.io/t/select-pages-using-where-fails-but-if-works-with-date-comparison/41550)

<div class="topic-metadata">

**Author:** [@j30](https://discourse.gohugo.io/u/j30)\
**Replies:** 5\
**Last updated:** [November 20, 2022, 1:16am UTC](https://discourse.gohugo.io/t/select-pages-using-where-fails-but-if-works-with-date-comparison/41550 "2022-11-20T01:16:19Z")

</div>

I have this project structure after running hugo new and adding minimal working files: project │ config.yaml │ └───layouts │ │ index.html │ │ │ └───\_default │ │ baseof.html │ │ └───layouts │ …

---

## [Same date sorts differently based on front matter in markdown](https://discourse.gohugo.io/t/same-date-sorts-differently-based-on-front-matter-in-markdown/41545)

<div class="topic-metadata">

**Author:** [@j30](https://discourse.gohugo.io/u/j30)\
**Replies:** 1\
**Last updated:** [November 19, 2022, 9:45pm UTC](https://discourse.gohugo.io/t/same-date-sorts-differently-based-on-front-matter-in-markdown/41545 "2022-11-19T21:45:49Z")

</div>

I have this project structure after running hugo new and adding minimal working files: project │ config.yaml │ └───layouts │ │ index.html │ │ │ └───\_default │ │ baseof.html │ │ └───layouts │ …

---

## [Weekday as int for calendar sheet](https://discourse.gohugo.io/t/weekday-as-int-for-calendar-sheet/38538)

<div class="topic-metadata">

**Author:** [@hug](https://discourse.gohugo.io/u/hug)\
**Replies:** 5\
**Last updated:** [May 11, 2022, 3:04pm UTC](https://discourse.gohugo.io/t/weekday-as-int-for-calendar-sheet/38538 "2022-05-11T15:04:24Z")

</div>

I’m trying to build a calendar month view in hugo, e.g. something like this: January 2022 M T W T F S S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 3…

---

## [Using time from YAML in \`where\`](https://discourse.gohugo.io/t/using-time-from-yaml-in-where/36545)

<div class="topic-metadata">

**Author:** [@trespaul](https://discourse.gohugo.io/u/trespaul)\
**Replies:** 3\
**Last updated:** [January 13, 2022, 5:10pm UTC](https://discourse.gohugo.io/t/using-time-from-yaml-in-where/36545 "2022-01-13T17:10:41Z")

</div>

Hi! I’m having some trouble with using dates from YAML in a template. I’m running into the issue of dates in YAML being strings while TOML has a datetime type. From a list of events, I want to grab the one that is next…

---

## [How to convert UTC+07:00](https://discourse.gohugo.io/t/how-to-convert-utc-07-00/33452)

<div class="topic-metadata">

**Author:** [@saefulrahman](https://discourse.gohugo.io/u/saefulrahman)\
**Replies:** 4\
**Last updated:** [June 19, 2021, 6:36pm UTC](https://discourse.gohugo.io/t/how-to-convert-utc-07-00/33452 "2021-06-19T18:36:35Z")

</div>

I want to add date meta on head. How to convert UT+C7:00 without parsing. In my front matter like this. date: 2021-06-18T07:20:00+07:00 I did convert to meta tag like this \<meta content="{{ .PublishDate.Format "2006-0…

---

## [Evaluate Expirydate with Javascript in real time](https://discourse.gohugo.io/t/evaluate-expirydate-with-javascript-in-real-time/30012)

<div class="topic-metadata">

**Author:** [@emk](https://discourse.gohugo.io/u/emk)\
**Replies:** 5\
**Last updated:** [December 16, 2020, 4:31am UTC](https://discourse.gohugo.io/t/evaluate-expirydate-with-javascript-in-real-time/30012 "2020-12-16T04:31:43Z")

</div>

For example, if you want to publish Events with HUGO Pages and use expirydate in Frontmatter, the entry disappears only with the next deploy. But with a little javascript you can hide the entry in the list template autom…

---

## [How to have index in all page with Hugo-scroll theme](https://discourse.gohugo.io/t/how-to-have-index-in-all-page-with-hugo-scroll-theme/28685)

<div class="topic-metadata">

**Author:** [@Reda](https://discourse.gohugo.io/u/Reda)\
**Replies:** 3\
**Last updated:** [October 7, 2020, 7:44am UTC](https://discourse.gohugo.io/t/how-to-have-index-in-all-page-with-hugo-scroll-theme/28685 "2020-10-07T07:44:01Z")

</div>

Hi, I’m a new and I’m happy to post my question here, I build my hugo site with the theme “hugo-scroll”. I made several pages in markdown, the problem is that when I navigate on these pages, I no longer have the elemen…

---

## [Some post dates are correct, most are Jan 1, 0001](https://discourse.gohugo.io/t/some-post-dates-are-correct-most-are-jan-1-0001/28536)

<div class="topic-metadata">

**Author:** [@zanshin](https://discourse.gohugo.io/u/zanshin)\
**Replies:** 9\
**Last updated:** [September 28, 2020, 11:04pm UTC](https://discourse.gohugo.io/t/some-post-dates-are-correct-most-are-jan-1-0001/28536 "2020-09-28T23:04:30Z")

</div>

I’m converting posts from Jekyll to Hugo. I wrote a script that ensures all the meta data dates are in the format YYYY-MM-DDTHH:MM-05:00. (Some were had just YYYY-MM-DD, other had the time too, and some were enclosed in …

---

## [Calculating with dates](https://discourse.gohugo.io/t/calculating-with-dates/28361)

<div class="topic-metadata">

**Author:** [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Replies:** 5\
**Last updated:** [September 23, 2020, 2:14pm UTC](https://discourse.gohugo.io/t/calculating-with-dates/28361 "2020-09-23T14:14:30Z")

</div>

I am playing around with my Netlify headers/redirection/robots component. Right now I expire locally cached pages by hardcoding this years last day into the file for the Expires header. Expires: Tue, 31-Dec-2020 23:59:5…
