Notice
Recent Posts
Recent Comments
Link
아미(아름다운미소)
[Python] 파이썬에서 현재 시간을 밀리 초 단위로 가져오기 본문
방법1
from datetime import datetime dt = datetime.now() dt.microsecond방법2
from datetime import datetime dt = datetime.now() print dt.microsecond/1000 + dt.second*1000밀리 초 단위로 현재 UTC 시간을 얻는 가장 간단한 방법
# timeutil.py
import datetime
def get_epochtime_ms():
return round(datetime.datetime.utcnow().timestamp() * 1000)
# sample.py import timeutil timeutil.get_epochtime_ms()
'랭귀지 > python' 카테고리의 다른 글
| Python 3 특정 출력에 색상을 지정 (0) | 2018.08.24 |
|---|---|
| Python 하위 디렉터리 검색을 쉽게 해주는 os.walk (0) | 2018.08.23 |
| abs (0) | 2018.08.20 |
| python open 함수 (0) | 2018.08.19 |
| FFmpeg 옵션 (0) | 2018.08.18 |
Comments