Python: Getting the Current Year, Day, Month, Hour, Minute, Second… Even Microsecond? EH?

This is more to be filed under “I don’t want to have to search the wabz for this again so I’m using my blog to post something so I don’t have to”, but if someone else in this world gets something from this, then well someone else in the world gets something from this. As I’m the only person I care about, helping myself is about as far as my concern goes.

This is really simple:

import datetime from datetime

    def someMethod():

       currentMinute =
       currentHour =

       currentDay =
       currentMonth =
       currentYear =

And actually there is one more if you print out

2010-09-24 10:06:06.599000

That .599000 is called microsecond:

Anyhow, thanks for playing.