Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 29 | 30 |
Tags
- python
- ASP
- Excel
- 라즈베리파이
- PyQt5
- pandas
- mssql
- 리눅스
- 다이어트
- ubuntu
- 맛집
- swift
- PyQt
- Linux
- Unity
- 함수
- GIT
- port
- javascript
- IOS
- urllib
- MS-SQL
- flutter
- 날짜
- tensorflow
- PER
- node.js
- sqlite
- 유니티
- MySQL
Archives
아미(아름다운미소)
시간차이 본문
from datetime import datetime
# 문자열 형태의 시간
time_str1 = "2023-10-15 14:30:00"
time_str2 = "2023-10-15 16:45:30"
# 문자열을 datetime 객체로 변환
time1 = datetime.strptime(time_str1, "%Y-%m-%d %H:%M:%S")
time2 = datetime.strptime(time_str2, "%Y-%m-%d %H:%M:%S")
# 차이 계산
difference = time2 - time1
print(f"시간 차이: {difference}")
Comments
