Emacs is two hours from system time. I tried to solve the problem, but no luck. What do I need to configure to fix this? I suspect this is a difference from GMT to where I live (I am in GMT + 2 zone, that is, if I subtract from system time 2, I will find time in Emacs). So ... maybe some locale settings?
I just messed up the git repository because of this: I made use of Emacs through magit and put them in front of commits made by someone else :(

Here I added a screenshot showing the difference. The result from date is the correct time, but the time on the model fringe is incorrect.
EDIT0:
It seems that Stefan is right, and the time in git is not related to the time in Emacs (screenshot below from the Cygwin terminal).
This question has to do with git as Emacs - somehow they use some kind of system API that drops out of sync on my PC - and this is what I need to configure them on it. The question is, what are they both using?

EDIT1:
Here is the code that Emacs uses to extract time, afaik:
int gettimeofday (struct timeval *__restrict tv, struct timezone *__restrict tz) { struct _timeb tb; _ftime (&tb); tv->tv_sec = tb.time; tv->tv_usec = tb.millitm * 1000L; if (tz) { tz->tz_minuteswest = tb.timezone; tz->tz_dsttime = tb.dstflag; } return 0; }
And it looks like he is wrong tz . I donβt know what _ftime , but it does not seem to be defined in Emacs sources, this should come from other sources ...
Some more research:
SBCL installed from MSI gives the following:
(defconstant *day-names* '("Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" "Sunday")) (multiple-value-bind (second minute hour date month year day-of-week dst-p tz) (get-decoded-time) (format t "It is now ~2,'0d:~2,'0d:~2,'0d of ~a, ~d/~2,'0d/~d ( GMT~@d )" hour minute second (nth day-of-week *day-names*) month date year (- tz)))
Exit: (actual time 12:56)
It is now 10:56:55 of Tuesday, 6/04/2013 (GMT+0)
Perl from ActivePerl (installed from Cygwin):
$now = localtime; print $now;
Output: (actual time 12:52)
Tue Jun 4 12:52:17 2013
CPython installed from MSI.
import datetime str(datetime.datetime.now())
Output: (actual time 13:03)
2013-06-04 11:03:49.248000
JavaScript, Node.js installed from MSI:
Date();
Exit: (Current time is 12:09)
Tue Jun 04 2013 10:09:05 GMT+0000 (IST)
Bash (Cygwin):
$ date
Output: (actual time 1:10 p.m.)
04 Jun, 2013 13:10:37
WITH#:
using System; namespace TestTime { class Program { static void Main(string[] args) { DateTime d = DateTime.Now; Console.WriteLine("Today: {0}", d); Console.ReadLine(); } } }
Output: (actual time 13:13)
Today: 04-Jun-13 13:13:37
EDIT2:
Today, our system administrator gave me a virtual machine to move my things. I wonder what happened that this time I got git through Cygwin, and now git is showing the correct times. However, Emacs still shows the wrong time. Python (and not the one associated with Cygwin) shows the correct time if it is running with Cygwin and erroneous time if it is running with Emacs! SBCL shows the wrong time no matter how it starts.
Is this possible in some network settings? Perhaps something has to do with how Windows synchronizes system time?