Why not just int(time.time()) ? Not sure what you are trying to do, but perhaps time.strftime() will save you some work?