stop right there, I see a lot of confusion going around :-P

unless in sqlite, where dates are stored as strings and parsed back, 
datetimes in other engines are stored as datetimes (meaning, not strings). 
the %Y-%m-%d notation is the ISO format (i.e. a default way to represent a 
date as a string).
What you get back using a select() is indeed a datetime object.

So, what you want to change is the **representation** of that datetime 
object as a string, not the way it's stored.

BTW, the IS_DATE validator attached to any Field has a default 
"represent()" function that "translates" the date into the local format, 
using T(), so e.g. if you're displaying records using SQLTABLE or 
SQLFORM.grid, or a form, those "datetimes" gets formatted (represent()ed) 
according to the specification of the '%Y-%m-%d' string in your languages 
(and the calendar widget gets translated too).
So the question is: how are you displaying your data ? If you're not using 
web2py "facilities", you can either use strftime or the represent() itself.
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Rendering-rows-using-represent

On Monday, December 30, 2013 8:27:30 PM UTC+1, software.ted wrote:
>
> I have noted that mysql stores its dates as "%Y-%m-%d", i would like to 
> know if the Field() or any DAL method is available to change the date to 
> "%d/%m/%Y" when doing a select?
>
>  
>
> -- 
>
> .......................................................................................
> Teddy Lubasi Nyambe
> Opensource Zambia
> Lusaka, ZAMBIA
>
> Cell: +260 97 7760473
> website: http://www.opensource.org.zm
>
> ~/
> Human Knowledge belongs to the world! - AntiTrust
>
> Man is a tool-using animal. Without tools he is nothing, with tools he is 
> all - Thomas Carlyle 1795-1881
>
> /~ 
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to