Query system date

Jesper Hertel jh at cddk.dk
Thu Sep 9 10:44:02 EDT 1999


Hello Mark,

Try this:

def getCurrentTimeString():
    from time import *
    return strftime ("%d-%m-%Y", localtime(time()))

print getCurrentTimeString()


Jesper Hertel

<mdperry_26 at my-deja.com> wrote in message
news:7r8fjh$dno$1 at nnrp1.deja.com...
> I am new to python and I am trying to figure out how to return the
> computers system date and time and then format it as MM-DD-YYYY.  I have
> searched the documentation up and down and have not found anything about
> how to accomplish this.  Any help would be greatly appeciated.
>
> Thanks,
>
> Mark.
>
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.






More information about the Python-list mailing list