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 | 31 |
Tags
- mssql
- javascript
- urllib
- 함수
- 다이어트
- GIT
- IOS
- Excel
- 유니티
- flutter
- PyQt5
- PyQt
- 리눅스
- swift
- port
- 맛집
- PER
- 날짜
- Unity
- MS-SQL
- python
- pandas
- node.js
- ubuntu
- MySQL
- 라즈베리파이
- sqlite
- Linux
- ASP
- tensorflow
Archives
아미(아름다운미소)
[Python] 어제 날짜 구하기 본문
어제 날짜 구하기
#! /usr/bin/python2.7 # -*- coding: utf-8 -*- #import datetime #now = datetime.datetime.now() #dt = now.strftime('%Y-%m-%d_%H:%M:%S') import time from datetime import date today = date.today() yesterday = date.fromtimestamp(time.time() - 60*60*24) dty = yesterday.strftime('%Y-%m-%d')) dty = yesterday.strftime('%Y%m%d') dt = today.strftime('%Y-%m-%d') dt = today.strftime('%Y%m%d') print(" dty : "+ dty ) print(" dt : "+ dt )
'랭귀지 > python' 카테고리의 다른 글
for와 함께 자주 사용하는 range함수 (0) | 2018.10.31 |
---|---|
python null 처리방법 (0) | 2018.10.29 |
python py2exe를 이용한 파이썬 실행파일 만들기 (0) | 2018.10.25 |
python shutil (0) | 2018.10.24 |
python switch문 (0) | 2018.10.21 |
Comments