How to add hours to current time in python

from datetime import datetime, timedelta nine_hours_from_now = datetime.now() + timedelta(hours=9) #datetime.datetime(2012, 12, 3, 23, 24, 31, 774118) And then use string formatting to get the relevant pieces: >>> ‘{:%H:%M:%S}’.format(nine_hours_from_now) ’23:24:31′ If you’re only formatting the datetime then you can use: >>> format(nine_hours_from_now, ‘%H:%M:%S’) ’23:24:31′ Or, as @eumiro has pointed out in comments – strftime

momentJS date string add 5 days

UPDATED: January 19, 2016 As of moment 2.8.4 – use .add(5, ‘d’) (or .add(5, ‘days’)) instead of .add(‘d’, 5) var new_date = moment(startdate, “DD-MM-YYYY”).add(5, ‘days’); Thanks @Bala for the information. UPDATED: March 21, 2014 This is what you’d have to do to get that format. Here’s an updated fiddle startdate = “20.03.2014”; var new_date = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)