Working on a small project that renders a database from SQL to a HTML page using Python Flask.
Trying to change the date notation from "%y-%m-%d %H:%M" to "%d-%m-%y %H:%M".
Using the below code:
</tr>
{% for item in items %}
<tr>
<td>{{item[0]}}</td>
<td>{{item[1]}}</td>
<td>{{item[2]}}</td>
<td>{{item[4].strftime("%d-%m-%y %H:%M")}}</td>
<td>{{item[5].strftime("%d-%m-%y %H:%M")}}</td>
<td>{{item[7].strftime("%d-%m-%y %H:%M")}}</td>
<td>{{item[10].strftime("%d-%m-%y %H:%M")}}</td>
<td>{{item[12].strftime("%d-%m-%y %H:%M")}}</td>
<td>{{item[13]}}</td>
</tr>
when I run the code in the localhost i get the following error.
jinja2.exceptions.UndefinedError: 'str object' has no attribute 'strftime'
Tried to define an own filter, didn't work either.
Hope all clear, Thanks.