Technology Bytes
Solution to common everyday Technology problems
Pages
Home
Saturday, June 9, 2012
Python: Get current time in required format
def Get_Current_Time():
'Returns current date time in format "%Y_%m_%d_%H_%M_%S"'
now = datetime.datetime.now()
return str(now.strftime("%Y_%m_%d_%H_%M_%S"))
No comments:
Post a Comment
Please write your comments and suggestions
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Please write your comments and suggestions