Twig date loop each day in a period

You cannot define a range of exact dates (neither as range in php) but you can create a range of seconds with step of a 24 hours second which is 86400; if you use date('U') it will convert date string to seconds since the Unix Epoch (same as Time() in php)

{% set start_date = '01-06-2014' %}
{% set end_date = '05-06-2014' %}
{% for x in range(start_date|date('U'), end_date|date('U'), 86400 ) %}
   {{ x|date('d/m/Y') }}<br>
{% endfor %}

Tip
Pay attention the format of date to use - as separator not / because it will lead to totally different result

Tags:

Twig

Period