From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Time zone trouble without time zones being involved Date: Sun, 3 Apr 2016 12:43:40 +0600 Message-ID: References: <87shz3cjbo.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1459665856 20310 80.91.229.3 (3 Apr 2016 06:44:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Apr 2016 06:44:16 +0000 (UTC) Cc: Emacs mailing list To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Apr 03 08:44:15 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1amble-0004AG-N6 for geh-help-gnu-emacs@m.gmane.org; Sun, 03 Apr 2016 08:44:14 +0200 Original-Received: from localhost ([::1]:52245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amble-0007xh-2M for geh-help-gnu-emacs@m.gmane.org; Sun, 03 Apr 2016 02:44:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amblS-0007xZ-PG for help-gnu-emacs@gnu.org; Sun, 03 Apr 2016 02:44:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1amblR-0003Zj-Tn for help-gnu-emacs@gnu.org; Sun, 03 Apr 2016 02:44:02 -0400 Original-Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]:32801) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amblR-0003Zf-Kl for help-gnu-emacs@gnu.org; Sun, 03 Apr 2016 02:44:01 -0400 Original-Received: by mail-lf0-x242.google.com with SMTP id r62so4309851lfd.0 for ; Sat, 02 Apr 2016 23:44:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=tBJQMDgIfoytWWJ1gB3SDQVdZuPwKLqeOFK8YD2cT60=; b=bEvXCCJHacQYXPyKfhT+s2BgYXvs9Tu8bctIxontfhStAu70709yClHJXBwvfpb0E/ 3MErpuxMPTXgtUA9zLNsKu7pKmagpDxyO9u3xq0GxMpdrpXKwoq3NxS31GzE6r/b43Mt vBc7uwIo+v/KBP14Vp0rLMmdpgBFu9rcEfnrUizx35KAp5xwRi4V/QBOOtZp8emHQvj/ oEuX3GIIlYuLzM5RGOVCyaSjWiOdYFEpdW/HcQoSNwu/rYdXLR3mvpGQshRuB3xlT+0x pTnPKCvrjW89cL27O89JiIDLmbXfpP1YLqo0r8g9zFsAeoRhcGQjOPziyZoaMvxwXhZY xWyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=tBJQMDgIfoytWWJ1gB3SDQVdZuPwKLqeOFK8YD2cT60=; b=nG8HfLnMZGmbHzFf2eJFowZ2hncdIuY2QhAjkB/Wra6LLxRj6aIEA83k1t0mJy/iGt vMLmvXekvf9HT40YV6SqP/hiIxkiCgani4itbA0jl2gAQTkuIxjoKveZc0nj0IVqbgTy KvXMFvQVGBqrpDsE7TnwUgGL8cXzcsD/y0RJ4P0pVhytcvHW73QQFxHyUlKqsJDTkE0x M1qEVuGnkpGMs0M0IfhKxrt1msIpET61gIuSBCRv9JHpTKwQrKx8a9h3rKmYB4pk8dfk 3JEZgDZ1g+wSTCXRWeWeA0lrmOy2vemdPi5LOM+z9XmgaPy/k7efm5fcK7bsHqqb1php V/SQ== X-Gm-Message-State: AD7BkJLxJ4GOIO0xfFjuYgLC/KxvnGUdJ9Q1XaQzsVlei36claLQ3Kfn07gOhu6//QgzNusIUgpY9876lgVzuA== X-Received: by 10.25.25.7 with SMTP id 7mr5413049lfz.166.1459665840365; Sat, 02 Apr 2016 23:44:00 -0700 (PDT) Original-Received: by 10.112.172.197 with HTTP; Sat, 2 Apr 2016 23:43:40 -0700 (PDT) In-Reply-To: <87shz3cjbo.fsf@web.de> X-Google-Sender-Auth: 3wNCF-f4xqGhMUcgXx4xOdEm8yU X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::242 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:109713 Archived-At: On Sun, Apr 3, 2016 at 12:11 PM, Michael Heerdegen wrote: > I'm using git to make a backup of the file I'm working with after every > save. I want to display the age of the last backup made in the > mode-line. [=E2=80=A6snipped=E2=80=A6] Your method looks sane to me, although the mention of TZ and mktime regarding %s bother me a bit. > The problem: since we have Daylight saving time, this always shows one > hour less than the expected value (directly after saving it shows > -0:59h). This makes no sense to me, since I only work with "seconds > since Epoch" absolute time values that I thought would not depend on the > local time zone. So either git or Emacs seems to make an error. Let=E2=80=99s determine which. 1. Mark the current UTC time, both as a human-readable string and as a unixtime value (e.g. on GNU, =E2=80=9Cdate --utc --rfc-3339=3Dseconds=E2=80= =9D and =E2=80=9Cdate +%s=E2=80=9D, respectively). 2. Make a commit. 3. Execute the same command, =E2=80=9Cgit log --pretty=3Dformat:%ad --date= =3Dformat:%s -n1=E2=80=9D. 4. Evaluate (current-time) and convert the first two elements of the resulting 4-element list to unixtime. 5. Check that the three unixtime values from steps 1, 3 and 4 are reasonably close. 6. By the way, which OS are you on?