python datetime.datetime how to add 1 hour code example

Example 1: datatime add time in float

>>> import datetime
>>> d = datetime.datetime(2016, 11, 17)
>>> delta = datetime.timedelta(hours=4.1326742)
>>> d + delta
datetime.datetime(2016, 11, 17, 4, 7, 57, 627120)

Example 2: jquery convert time to 1day 2 minutes 4 seconds

function secondsToDhms(seconds) {
  seconds = Number(seconds);
  var d = Math.floor(seconds / (3600*24));
  var h = Math.floor(seconds % (3600*24) / 3600);
  var m = Math.floor(seconds % 3600 / 60);
  var s = Math.floor(seconds % 60);

  var dDisplay = d > 0 ? d + (d == 1 ? " day, " : " days, ") : "";
  var hDisplay = h > 0 ? h + (h == 1 ? " hour, " : " hours, ") : "";
  var mDisplay = m > 0 ? m + (m == 1 ? " minute, " : " minutes, ") : "";
  var sDisplay = s > 0 ? s + (s == 1 ? " second" : " seconds") : "";
  return dDisplay + hDisplay + mDisplay + sDisplay;
}