Re: date to digit




"Sara Khalatbari" <sarapythonlist@xxxxxxxxx> ha scritto nel messaggio
news:mailman.57.1114858019.14961.python-list@xxxxxxxxxxxxx
> Is there a program in python that inputs a date & a
> time, for example: "2005-04-17 04:20+0000". And
> returns a digit, for example: "3501" instead?
>
> and if there is such program or built-in function, how
> can I run it inside a code?

Here you go:

>>> a = time.strptime("2005-04-17 04:20", "%Y-%m-%d %H:%M")
>>> time.mktime(a)
1113704400.0

F.P.



>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com




.



Relevant Pages

  • installing vrmlexport module ??
    ... python vrmlexport.py ... Traceback: ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (comp.lang.python)
  • re:SWIG again
    ... sorry, I chose the digest mode when I signed up, and I ... executable instead of the Windows python executable. ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (comp.lang.python)
  • Re: Cant Upgrade Python Through Ports
    ... I've tried installing from FreeBSD ports and ... when I call up my python interpreter it tells me I'm ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (freebsd-questions)
  • Fwd: Re: How to upgrade python from 2.4.3 to 2.4.4 ?
    ... the installer compatible with the new Python ... especially since I havent got MS visual studio... ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (comp.lang.python)
  • date to digit
    ... returns a digit, for example: ... and if there is such program or built-in function, ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (comp.lang.python)