From 7c392adb51583d7e0341a4376698ffadd9e305a3 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 16 Jun 2015 14:48:37 +0530 Subject: [PATCH] [fix] Consider microseconds in to_timedelta function --- frappe/utils/data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/utils/data.py b/frappe/utils/data.py index ff39a85fee..6f844e570c 100644 --- a/frappe/utils/data.py +++ b/frappe/utils/data.py @@ -57,7 +57,7 @@ def get_datetime(datetime_str=None): def to_timedelta(time_str): if isinstance(time_str, basestring): t = parser.parse(time_str) - return datetime.timedelta(hours=t.hour, minutes=t.minute, seconds=t.second) + return datetime.timedelta(hours=t.hour, minutes=t.minute, seconds=t.second, microseconds=t.microsecond) else: return time_str