Contact: aviboots(AT)netvision.net.il
38,933 questions
50,642 answers
573 users
import datetime now = datetime.datetime.now() print("day - %s" % now.day) print("month - %s" % now.month) print("year - %s" % now.year) print("hour - %s" % now.hour) print("minute - %s" % now.minute) print("second - %s" % now.second) ''' run: day - 23 month - 6 year - 2015 hour - 19 minute - 25 second - 36 '''
import datetime now = datetime.datetime.now() print("dd/mm/yyyy - %s/%s/%s" % (now.day, now.month, now.year)) print("hh:mm:ss - %s:%s:%s" % (now.hour, now.minute, now.second)) ''' run: dd/mm/yyyy - 23/6/2015 hh:mm:ss - 19:30:14 '''