Posted By

iloveitaly on 06/12/09


Tagged

format python DateTime


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

louscomp
gartenstuhl


Python Datetime Usage


 / Published in: Python
 

For some reason it took me a bit to realize that you had to use datetime.datetime

  1. import datetime
  2.  
  3. # ex: 09-06-12-10-01
  4. print datetime.datetime.now().strftime("%y-%m-%d-%H-%M")

Report this snippet  

You need to login to post a comment.