Contact: aviboots(AT)netvision.net.il
38,933 questions
50,642 answers
573 users
import datetime now = datetime.datetime.now() print(now.year, "-", now.month, "-", now.day, sep='') print(now.hour, ":", now.minute, ":", now.second, sep='') ''' run: 2017-11-6 21:32:28 '''
import time year, month, day, hour, minute, second = time.strftime("%Y,%m,%d,%H,%M,%S").split(',') print(year, "-", month, "-", day, sep='') print(hour, ":", minute, ":", second, sep='') ''' run: 2017-11-06 21:46:18 '''