Format date

Hi all How to format date in volt, this is my code {{ date('d-m-Y',date)}}, run error : A non well formed numeric value encountered in

If i use php <?php print_r (date("d-m-Y",strtotime($date)));?> very gool, i doesn't see strotime in volt



7.1k

just write ```php {{ date("d-m-Y") }} ``` or ```php {{ date("d-m-Y", time()) }} ``` If you want print custom time from variable, this variable must be integer type of Unix timestamp. Example ```php {% set today = time() %} <p>Today is: {{ date("d-m-Y", today) }} </p>

{% set tomorrow = time()+86400 %} <p>Tomorrow is: {{ date("d-m-Y", tomorrow) }} </p> ```



23.1k

Register the strtotime function as shown in the documentation http://docs.phalconphp.com/en/latest/reference/volt.html#id3 Then you can use

{{ date('d-m-Y', strtotime(date)) }}