lumeland / theme-simple-blog

Lume theme to create a simple blog
https://lumeland.github.io/theme-simple-blog/
MIT License
49 stars 23 forks source link

Incorrect date displayed from `date` metadata in post file #8

Closed naltun closed 1 year ago

naltun commented 1 year ago

I have the following in ~/workspace/my-blog/posts/whoami.md:

---                                                                                                                                     
title: /usr/bin/whoami                                                                                                                  
date: 2023-01-05
author: Noah                                                                                                                            
---

When viewing the generated post, I get this: image

Notice how the date is January 4th, 2023, although the date is specified as 2023-01-05.

When viewing my local datetime, I get January 5th:

~ $ date
Thu Jan  5 04:10:43 PM PST 2023
oscarotero commented 1 year ago

Probably it's due the timezone. The date 2023-01-05 is interpreted as 2023-01-05 00:00:00, and if your timezone is -1h or less, it becomes to one day before (See this https://github.com/lumeland/lume/issues/58)

Try defining the TZ environment variable to your own timezone or Z (for example TZ=Z deno task serve)

naltun commented 1 year ago

@oscarotero I will try that when I get a chance. I deployed to Deno Deploy and it's displaying the date appropriately. I believe your observation is correct. Feel free to close.

Edit: I will close this myself. Thank you for linking the issue.