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

fishercoder1534 picture fishercoder1534  路  26Comments

LouisBarranqueiro picture LouisBarranqueiro  路  28Comments

fabien-h picture fabien-h  路  22Comments

SukkaW picture SukkaW  路  25Comments

scaljeri picture scaljeri  路  44Comments