Using the below code, I can fetch the current date and time in python:
#!/usr/bin/python
import time
now = time.strftime("%c")
print "Current time %s" % now
This will output:
Current time Mon Oct 24 09:25:17 2016
But, I need to change the system time to Mon Oct 24 11:25:17 2016
i.e. I need to set system date by adding 2 hours to existing time. Need to change the system date to 2 hours from now. (this question has been marked as duplicate, please check the question once)
This needs to be performed for Linux and Solaris hosts.
Please consider me as a python beginner and provide solutions.