If your goal is to render on a web2py template, you need to use pure Python to format
{{=row.datetime_field.strftime("%d/%m/%Y")}}
The above will generate 25/09/2012
Tell us about Python strftime docs.
If you want to show only the day.
{{=row.datetime_field.date}}
You can also set it as a view for this field.
db.mytable.datetime_field.represent = lambda value, row: value.strftime("format-here")
The view will only be useful for SQLFORM.grid and SQLTABLE
All you need is strftime
source share