Guy Hulbert wrote:

>On Wed, 2007-31-01 at 12:17 -0500, Guy Hulbert wrote:
>  
>
>>>I would like to display my dates with format '%d/%m/%Y'  instead of
>>>      
>>>
>>ISO 
>>    
>>
>>>format.
>>>
>>>qry = session.query(Nazione).select(Nazione.c.codice=='201')
>>>qry[0].data_inizio
>>>print qry[0].data_inizio
>>>2006-01-14
>>>
>>>
>>>      
>>>
Thank you Guy to answer my question.
I know I can use the strftime property of datetime to format my dates as:

qry.data_inizio.strftime('%d/%m/%Y')  

but what I'm looking for, is a way to setting date style in SA or 
psycopg2 whithout need to apply functions
to change the default format.
Is it possible?

jo

>>>Is there a way to set it in SA without using a customer function  ?
>>>      
>>>
>>Something like:
>>
>>'/'.join(s.split('-').reverse())
>>
>>where 's' is the string you want to reformat, would do it.
>>    
>>
>
> s = '2006-01-14'
> l = s.split('-')
> s = '/'.join(l)
>
>does work (I haven't been using python long enough to get it into a
>line :-( ... i'll shut up now ...
>
>  
>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to