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

Archived:How to format time in PySymbian

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.

143 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved