from datetime import datetime
def get_curtime_as_string(): timestamp = '%d_%d_%d_%d_%d_%d_%d' % ( datetime.now().year, datetime.now().month, datetime.now().day, datetime.now().hour, datetime.now().minute, datetime.now().second, datetime.now().microsecond ) return timestamp