반응형

어제 날짜 구하기 


#! /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 )


.

반응형

+ Recent posts