728x90

from datetime import date, timedelta, time, datetime

start_date = date(2021, 1, 1)
start_time=time(0,0,0)
end_date = date(2021, 1, 1)
end_time=time(1,0,0)
start = datetime.combine(start_date, start_time)
end = datetime.combine(end_date, end_time)
delta = timedelta(minutes=1)
while start <= end:
    print (start.strftime("%Y-%m-%d %H:%M:%S"))
    start += delta

728x90

'Python' 카테고리의 다른 글

nan can not be used with MySQL  (0) 2021.01.27
python list to df(dataframe)  (0) 2021.01.27
UPBIT QUERYSTRING 날짜 형식  (0) 2021.01.27
not all arguments converted during string formatting  (0) 2021.01.26
python if 한줄코딩  (0) 2021.01.26

+ Recent posts