Skip to content

permalink date is incorrect if the time zone of _config.yml and the time zone setting of the machine are different #3282

Open
@MatchaChoco010

Description

@MatchaChoco010

Environment Info

Node version(node -v):v10.9.0

site to reproduce the ploblem:

https://github.com/MatchaChoco010/hexo-timezone-permalink

$ hexo version
hexo: 3.7.1
hexo-cli: 1.1.0
os: Linux 4.4.0-17134-Microsoft linux x64
http_parser: 2.8.0
node: 10.9.0
v8: 6.8.275.24-node.14
uv: 1.22.0
zlib: 1.2.11
ares: 1.14.0
modules: 64
nghttp2: 1.32.0
napi: 3
openssl: 1.1.0i
icu: 62.1
unicode: 11.0
cldr: 33.1
tz: 2018e

For BUG

_config.yml is this:

...
timezone: America/New_York
...
permalink: :year/:month/:day/:title/
...

and source/_posts/test.md is this:

---
title: test
date: 2018-10-11 23:00:00
tags:
---

The permalink of this article should be /2018/10/11/test/.
But hexo generate in Japan, which +0900, /2018/10/12/test/index.html is generated.

screenshot0

The article date is correct (2018/10/11).

screenshot1

Change the machine timezone to -0500 and hexo generate, /2018/10/11/test.index.html is generated.

It seems that the permalink is not generated correctly if the time zone of _config.yml and the time zone setting of the machine are incorrect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdates

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions