Add hours to datetime in Python #. Use the timedelta() class from the datetime module to add hours to datetime, e.g. result = dt + timedelta(hours=10) .
確定! 回上一頁