Difference between revisions of "Python: Print waktu"

From OnnoWiki
Jump to navigation Jump to search
(New page: Source import datetime print datetime.datetime.now() Jika dijalankan akan keluar kira-kira 2015-11-28 09:12:03.465258)
 
Line 1: Line 1:
 +
==Time==
 +
 
Source
 
Source
  
Line 8: Line 10:
  
 
  2015-11-28 09:12:03.465258
 
  2015-11-28 09:12:03.465258
 +
 +
 +
==Time Stamp==
 +
 +
import time
 +
import datetime
 +
 +
n = datetime.datetime.now()
 +
unix_time = time.mktime(n.timetuple())

Revision as of 19:06, 28 November 2015

Time

Source

import datetime
print datetime.datetime.now()


Jika dijalankan akan keluar kira-kira

2015-11-28 09:12:03.465258


Time Stamp

import time
import datetime
n = datetime.datetime.now()
unix_time = time.mktime(n.timetuple())