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

scaljeri picture scaljeri  路  44Comments

dsaltares picture dsaltares  路  46Comments

tomap picture tomap  路  21Comments

pod4g picture pod4g  路  24Comments

icepy picture icepy  路  34Comments