과거 임의의 시점에 기록된 데이터에서 그 데이터의 일시(datetime)가 현재와 어느 정도 시차를 가지고 있는지를 확인하기 위한 파이썬 프로그램 def GetTimeDifference(cls, dateIn): #dateIn : "2020-01-01 12:23:45" date0 = datetime.now() date1 = datetime.strptime(dateIn, "%Y-%m-%d %H:%M:%S") dateD = date0 - date1 daysD = dateD.days secondsD = dateD.seconds timeD = { 'Day': daysD, 'Second': secondsD } #print(dateD.days) return timeD
날짜와 시간 함수를 이용하여 각 항목(년, 월, 일, 시, 분, 초, 요일)에 대한 값을 획득하기 위한 방법 def GetTimeParam(cls, timeIn=None): if not timeIn: timeIn = datetime.now() year1 = timeIn.strftime("%Y") month1 = timeIn.strftime("%m") day1 = timeIn.strftime("%d") hour1 = timeIn.strftime("%H") minute1 = timeIn.strftime("%M") weekDay = timeIn.weekday() rst1 = { 'Year': int(year1), 'Month': int(month1), 'Day': int(day1), 'Hour': int(ho..
- Total
- Today
- Yesterday
- ServantClock
- Innovations&Hurdles
- 치매
- 심심풀이
- bilient
- 전압
- 혁신과허들
- 티스토리챌린지
- DYOV
- 빌리언트
- Innovation&Hurdles
- Video
- 아두이노
- 치매방지
- 혁신
- Decorator
- 심심풀이치매방지기
- image
- badp
- BSC
- Innovations
- 배프
- 오블완
- 절연형
- 전류
- 전압전류모니터링
- 허들
- 둎
- Hurdles
- arduino
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |