取当前日期,如果为月初1号,则跳过该天取二号。
import datetime new = '2018-01-31 06:00:00' '''每月一号+1天''' new = datetime.datetime.strptime(new,"%Y-%m-%d %H:%M:%S")+datetime.timedelta(days=1) if(new[8:10]=='01') else new