.Unix
Syntax
.Unix
Example: Time Passed Since Last Modification
This very simple one-liner uses now.Unix
to calculate the amount of time that has passed between the .LastMod
for the current page and the last build of the current page.
time-passed.html
{{ div (sub now.Unix .Lastmod.Unix) 86400 }}
Since both values are integers, they can be subtracted and then divided by the number of seconds in a day (i.e., 60 * 60 * 24 == 86400
).