아미(아름다운미소)

판다(pandas)를 사용하여 현재 시간을 얻는 방법 본문

랭귀지/PYTHON

판다(pandas)를 사용하여 현재 시간을 얻는 방법

유키공 2018. 11. 8. 11:06
How to use the pandas to get the current time 
 - pandas 설치 
C:\ProgramData\Anaconda3\envs\py35>pip install install pandas=0.18.1
#-*- coding: utf-8 -*-
'''
Created on 2018. 10. 30.

@author: bhm
'''
#판다를 사용하여 현재 시간을 얻는 방법.
import pandas as pd
print (pd.datetime.now())
print (pd.datetime.now().date())
print (pd.datetime.now().year)
print (pd.datetime.now().month)
print (pd.datetime.now().day)
print (pd.datetime.now().hour)
print (pd.datetime.now().minute)
print (pd.datetime.now().second)
print (pd.datetime.now().microsecond)
2018-11-08 10:39:22.601097
2018-11-08
2018
11
8
10
39
22
601097


Comments