×
Namespaces

Variants
Actions
Revision as of 23:19, 26 September 2009 by nayan_trivedi (Talk | contribs)

Archived:How to format time in PySymbian

From Nokia Developer Wiki
Jump to: navigation, search
{{{width}}}

There are two ways of formatting time. For SQL you need e32.format_time :

>>> from e32db import format_time
>>> from time import *
>>> t = time()
>>> format_time(t) # for Symbian SQL
u'06/03/2006 23:26:35'

For other uses you can use strftime :

>>> from time import *
>>> strftime('%d/%m/%Y %H:%M:%S')
'06/03/2006 23:26:39'
>>> ctime()
'Mon Mar 06 23:26:49 2006'
>>> strftime("%a, %d %b %Y %H:%M:%S +0000") # email RFC
'Mon, 06 Mar 2006 23:26:59 +0000'

More info about other formatting parameters can be found here.

37 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×