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
- DB
- DATAPATH
- MIPS
- DS
- mysql
- while
- CSS
- instruction
- function
- MacOS
- web
- Algorithm
- Class
- computer
- data structure
- Java
- control
- Pipelining
- for
- system
- Linux
- html
- github
- architecture
- javascript
- DoM
- react
- php
- XML
Archives
- Today
- Total
YYYEJI
[Python] datetime 모듈 본문
728x90
모듈(module)이란?
모듈이란 함수나 변수 또는 클래스를 모아 놓은 파일입니다.
datetime 모듈을 이용하기 위해서는 data time 모듈을 import 해줘야됩니다.
from datetime import timedelta
• datetime 내장 모듈의 timedelta 클래스는 기간을 표현합니다.
• timedelta 클래스의 생성자는 주, 일, 시, 분, 초, 밀리 초, 마이크로 초를 인자로 받습니다.
from datetime import date, timedelta
today = date.today() # Today days
print(today)
one_week = timedelta(weeks=1) # Number of Weeks
print(one_week)
◡̈
'Python' 카테고리의 다른 글
[Python] 맥(MacOS)에서 Conda 설치하기 (0) | 2022.11.03 |
---|---|
[Python] Random 모듈 (0) | 2022.11.03 |
[Python] Math 모듈 (0) | 2022.11.03 |
[Python] Pillow(PIL) 모듈 (0) | 2022.11.03 |
[Python] 파이썬 터틀(Turtle)이란? (0) | 2022.10.24 |