Latest web development tutorials

파이썬 시간 시간 () 메소드

기술

파이썬 시간 시간은 () (초 부동 소수점 숫자 후 시대 1970) 현재 시간의 타임 스탬프를 돌려줍니다.

문법

시간 () 메서드 구문 :

time.time()

매개 변수

  • NA.

반환 값

(초 부동 소수점 숫자 후 시대 1970) 현재 시간의 타임 스탬프를 돌려줍니다.

다음은 시간 ()을 사용하는 기능을 보여준다

#!/usr/bin/python
import time

print "time.time(): %f " %  time.time()
print time.localtime( time.time() )
print time.asctime( time.localtime(time.time()) )

위 예제의 출력은 다음과 같습니다

time.time(): 1234892919.655932
(2009, 2, 17, 10, 48, 39, 1, 48, 0)
Tue Feb 17 10:48:39 2009