Skip to Content
Menu
This question has been flagged
974 Views

Hi, 

I want to convert datetime.timedelta into format 

'%Y-%m-%d' but I get the difference between the dates in days.

here are  my code :

/

date_today = fields.Date.today()
td = date_today + relativedelta(months=1)
dt = datetime.datetime.strptime(str(td), '%Y-%m-%d')
date_end= datetime.datetime.strptime(str(self.date_end), '%Y-%m-%d')
f = date_end - dt


Avatar
Discard
Related Posts Replies Views Activity
3
Oct 23
5979
1
Sep 23
1968
1
May 23
1004
2
Apr 23
1378
1
Mar 23
996