[Tutor] Crossfire problem

Alberto Troiano albertito_g at hotmail.com
Sat May 21 00:29:54 CEST 2005


Thank you very much Kent

That solved my entire problem

Best Regards

Alberto

>From: Kent Johnson <kent37 at tds.net>
>To: Alberto Troiano <albertito_g at hotmail.com>
>CC: tutor at python.org
>Subject: Re: [Tutor] Crossfire problem
>Date: Fri, 20 May 2005 18:06:40 -0400
>
>Alberto Troiano wrote:
> > These are the commands I need from datetime module. Is there another way 
>to
> > get this info????
> >
> > hoy=datetime.datetime.now() # Today's date and time as a tuple
> > dia=days[hoy.isoweekday()] # Today's dayweek as integer from 0 to 6
> > grupo=datetime.datetime.today().strftime("%Y%m%d%H%M%S") # string 
>today's
> > date and time
>
>These functions are all available in the time module which is older than 
>datetime:
>   >>> import time
>   >>> hoy = time.localtime()
>   >>> hoy
>(2005, 5, 20, 18, 1, 56, 4, 140, 1)
>   >>> hoy.tm_wday
>4
>   >>> time.strftime("%Y%m%d%H%M%S")
>'20050520180243'
>
> > I was looking for the datetime module so I can copy it to the libraries 
>of
> > Python 2.3.4.
>
>Google 'python datetime 2.2' for some alternatives.
>
>Kent
>
>_______________________________________________
>Tutor maillist  -  Tutor at python.org
>http://mail.python.org/mailman/listinfo/tutor




More information about the Tutor mailing list