I’m looking for a function to format a date in order to get day, month and year. Dates are being stored in my database in the following format 2012-09-26.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If your goal is to display on web2py template, so you have to use pure Python to format
The above will generate
25/09/2012Tale a look at Python strftime documentations.
If you want to show only the day.
Also you can set it as a representation for that field
The representation will be useful only on SQLFORM.grid and SQLTABLE
All you need is
strftime