HUGO

Hugo how to get the time difference?

Is there any way to get the time difference in Hugo?

With twig i can define a plug and apply it in the code.

  • {{ '2016-4-01' | time_diff }}
  • AFAIK, the best have right now can be found here:

    If you’re not opposed to using JavaScript for this, look into timeago.js. That way the time ago is updated dynamically as time passes, as opposed to having to rebuild Hugo every day.

    Thank you for your help, it solves my problem.