Get today's date in Jekyll with Liquid markup
It didn't work for me either. It appears you've hit a current bug in the Ruby 1.9.3 support. There is a pull request that fixes the bug, but it's not incorporated yet. A workaround is listed, perhaps it will work for you:
{{ site.time | date: '%y' }}
To get the whole year, for example "2015", from the site.time
, you can either use:
{{ site.time | date: '%Y' }}
# OR
20{{ site.time | date: '%y' }}
To just get the last 2 digits from the year 2015, this will just output "15":
{{ site.time | date: '%y' }}
Perhaps the question title is misleading but I actually wanted today's date and not the year. This works for me:
{{ site.time | date: '%B %d, %Y' }}
Today it produced: January 04, 2019