티스토리 뷰
728x90
def get_sec(time_str):
"""Get seconds from time."""
h, m, s = time_str.split(':')
return int(h) * 3600 + int(m) * 60 + int(s)
print(get_sec('1:23:45'))
print(get_sec('0:04:15'))
print(get_sec('0:00:25'))
https://stackoverflow.com/questions/6402812/how-to-convert-an-hmmss-time-string-to-seconds-in-python
How to convert an H:MM:SS time string to seconds in Python?
Basically I have the inverse of this problem: Python Time Seconds to h:m:s I have a string in the format H:MM:SS (always 2 digits for minutes and seconds), and I need the integer number of seconds...
stackoverflow.com
728x90
'공부' 카테고리의 다른 글
[python] 기본 날짜와 시간 형식 (0) | 2022.08.18 |
---|---|
[python] pandas loc - filter for list of values (0) | 2022.08.18 |
[python] convert string date to timestamp (0) | 2022.08.18 |
[npm] npm install --save-dev -g --save-exact prettier (0) | 2022.08.18 |
[github] install-aws-cli-action (0) | 2022.08.18 |
댓글
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- COUNT
- 테슬라 리퍼럴 코드 혜택
- 테슬라 레퍼럴 적용 확인
- 테슬라 리퍼럴 코드
- 인스타그램
- 테슬라
- 테슬라 크레딧 사용
- 모델y
- 할인
- 개리마커스
- 책그림
- follower
- 클루지
- 어떻게 능력을 보여줄 것인가?
- 테슬라 리퍼럴 코드 생성
- 테슬라 추천
- wlw
- 김달
- 테슬라 레퍼럴 코드 확인
- Kluge
- 메디파크 내과 전문의 의학박사 김영수
- 팔로워 수 세기
- 테슬라 레퍼럴
- 유투브
- 레퍼럴
- 연애학개론
- Bot
- 모델 Y 레퍼럴
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함