When I create my logfile, I want the name to contain the datetime.
In Python you can get the current datetime as:
>>> from datetime import da
You need datetime.strftime(), this allows you to format the timestamp using all of the directives of C's strftime(). In your specific case:
>>> datetime.now().strftime('mylogfile_%H_%M_%d_%m_%Y.log') 'mylogfile_08_48_04_02_2012.log'