Hexo: Change date format in Hexo?

Created on 19 Jan 2017  ·  2Comments  ·  Source: hexojs/hexo

Is there another way of displaying when an article was published? So not 12-06-2016 but rather Yesterday or 5 months ago. I was looking the http://momentjs.com/ site but not sure how to implement the Relative Time option.

Thank you.

Most helpful comment

You could use the moment helper: https://hexo.io/docs/helpers.html#moment

<%- moment('20161201', 'YYYYMMDD').fromNow() %>

All 2 comments

You could use the moment helper: https://hexo.io/docs/helpers.html#moment

<%- moment('20161201', 'YYYYMMDD').fromNow() %>

Perfect! Thank you...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Helihua1992 picture Helihua1992  ·  3Comments

hjmJhon picture hjmJhon  ·  3Comments

hgDendi picture hgDendi  ·  3Comments

netcan picture netcan  ·  3Comments

mashirozx picture mashirozx  ·  3Comments