How do I get the current time and date of the operating system (the one in the clock). I tried to use datetime.now(). But it returns different value.
As suggested by mcalex I've rechecked the time and date setting and this has always been like this:

How do I get the current time and date of the operating system (the one in the clock). I tried to use datetime.now(). But it returns different value.
As suggested by mcalex I've rechecked the time and date setting and this has always been like this:

Use time.localtime().
From https://docs.python.org/2/library/time.html#time.localtime
Like gmtime() but converts to local time. If secs is not provided or None, the current time as returned by time() is used. The dst flag is set to 1 when DST applies to the given time.
You can use the Python time module for various time-related functions.  It appears you are requesting the following format:
Day Month Hour:Min:Sec Year
If so, you can use the following:
>>> import time
>>> time.asctime(time.localtime())
'Mon Jun 30 22:19:34 2014'
To convert to a specific format, you can use the following function:
time.strftime(format[, t]) 
This converts a struct_time object tm representing a time as returned by gmtime() or localtime() to a string.  See the following link for more info on the format codes:
https://docs.python.org/2/library/time.html#time.localtime
Source: Beazley, D. M., "Python Essential Reference", 4th. Ed.