TechNote.kr

  • 홈
  • 태그

datetime 1

Python - datetime/time module, 현재 시간 출력 방법

datetime 혹은 time module 중 하나를 이용하여 현재 시간을 표시할 수 있다. 먼저 datetime 을 이용한 현재 시간 표현은 다음과 같다. import datetime now = datetime.datetime.now() print now 결과> $ python now_datetime.py 2018-06-05 10:30:06.986065 반면 time module을 이용하면 좀 더 세분화/정교화하여 표시할 수 있다. import time now = time.localtime() print "%04d/%02d/%02d %02d:%02d:%02d" % (now.tm_year, now.tm_mon, now.tm_mday, now.tm_hour, now.tm_min, now.tm_sec) 결과..

Language/Python 2018.06.16
1
더보기
  • TechNote.
    • Android
    • Language
      • R
      • C
      • Java
      • Python
      • Kotlin
      • HTML
      • Javascript
      • nvd3.js
      • Node.js
    • OS
      • Windows
      • Linux
      • Mac
      • OpenWRT, LEDE
    • Network
      • Wi-Fi
    • Products & Services
      • Django
      • AmazonWebService (AWS)
      • VirtualBox
      • Adsense
      • WordPress
      • Tistory
      • VS Code
      • Docker
    • Database
    • Application
      • KidsTube
      • Notepad++
    • Computer architecture
    • Software architecture
    • ETC

최근글과 인기글

  • 최근글
  • 인기글

Copyright © Kakao Corp. All rights reserved.

티스토리툴바