From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Time zone trouble without time zones being involved Date: Sun, 03 Apr 2016 08:11:55 +0200 Message-ID: <87shz3cjbo.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1459663949 27830 80.91.229.3 (3 Apr 2016 06:12:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Apr 2016 06:12:29 +0000 (UTC) To: Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Apr 03 08:12: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 1ambGh-0000DU-3V for geh-help-gnu-emacs@m.gmane.org; Sun, 03 Apr 2016 08:12:15 +0200 Original-Received: from localhost ([::1]:52166 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ambGg-0003B3-8Y for geh-help-gnu-emacs@m.gmane.org; Sun, 03 Apr 2016 02:12:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ambGU-0003AJ-Uq for help-gnu-emacs@gnu.org; Sun, 03 Apr 2016 02:12:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ambGR-0006jM-Nu for help-gnu-emacs@gnu.org; Sun, 03 Apr 2016 02:12:02 -0400 Original-Received: from mout.web.de ([212.227.15.14]:55379) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ambGR-0006jI-DX for help-gnu-emacs@gnu.org; Sun, 03 Apr 2016 02:11:59 -0400 Original-Received: from drachen.dragon ([92.74.175.38]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0MSrll-1bEP8r3tVV-00RtTJ; Sun, 03 Apr 2016 08:11:57 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-Provags-ID: V03:K0:P3V/VWlO7W/UdwS691mWwPy+qjlIC/k1sLWjbq17p7Yv9dVF5B/ IiWeCcJy3XRzosGUaZcMnRRJr11Ra82kS+ktTHg76HiW606l5zz9Gw44W+PFwzOz5ACbeIF T7qzNrh4ZJTfHsSO7+0djTIP4C47sFKnX53UCh65PrjICWYxE+yhg3Oa57Cdy1SxsSWNVRo Ee/pni3c2p6IV5CDuysuQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:n9vtALUUmQA=:1GtHP1fcRx/Ia2up+ndt+x F8F1ef75XR2i65+4NbPNBkQr7o10kT3UGWSPsLMUoutnmQrLA8AD8cnMpHmBP5UuBnwUNBF8A DtSqkn3g9a35tFjYCugHsNxLckV51WB63R0NM+YgVsjz+StgATRAxWy6sYYmgzDu28e6vVSoI MxZNlrV+J7bKQMZ4KmezEUEU6X6bKhDeMC6PdmNewz2zcuG2VFAjR7volnH6+4XnFnKNMRkGp XCFkU9Nj6G8f8TqDfMo/M2JqYUs44IUFIuNZiygsRyR1Vlzt28ds6jPX7IHPvxdkw4P6+0D3T wB7qHEe8VdBwpp3vzhZc0/8ibvlp0jIBylX4WSdIeA72/G0z1TABqIY+hoOrJ0Gu06CgpGeXE Z4M43oiU6XufhnPNsbl75ZsXVWb88eJL9dLJOB4pEAT8MLMN7GtB3/nROonPeuBrNfyRmcypL ZYubDb7xOuwBaIP+LR8Q4iyi4QdjX4Fg757btf2LnYwKCg2OX5m/kLgdQtwz2WGyxXsU2WkRN ehl0jCnNHNhQyKuEyYKikIcNIyy2H0brr6COc+0wusRdIelxp3FVjbQMMwj3mSpxcNwaY53oZ XD7Tfg/69kyUfvMDH+lWfnAWwPKauASjyjVq0Jzkc1nYrjifzvOfTSKvYwpef3+uGqISjhznE Xa3n1pdNsvVGWK07TtIyzZvu/6FqOU74tSqBXiY7bN0Gx/BoFmrehrOtzgwI+2uwc1nZRk0JW 26A/NxX8/5+4HiAiHO/Ry/ZJd+WyvpmW/CuBUDgjrDaHD6v4uxiqbE7pVnYN43FxZ3d7NsSG X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.14 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:109712 Archived-At: Hello, 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. To be able to control the time display format from Elisp, I decided to ask git-log for the time since "the Epoch": #+begin_src emacs-lisp (string-to-number (helm-backup-exec-git-command "log" ref "--pretty=format:%ad" "--date=format:%s" "-n1" filename-for-git)) #+end_src (where `helm-backup-exec-git-command' just calls "git" with the specified args). "%ad" means "author date", and "%s" means, according to "man strftime", "The number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). (TZ) (Calculated from mktime(tm).)" After saving a file, this value is saved to the local variable `helm-backup-time-of-latest-backup'. In the mode-line, I show this: #+begin_src emacs-lisp (helm-backup-time-of-latest-backup (:eval (progn (require 'timeclock) (propertize (concat " " (timeclock-seconds-to-string (time-to-seconds (time-subtract (current-time) (seconds-to-time helm-backup-time-of-latest-backup)))) "h") 'face 'mode-line-shadow)))) #+end_src 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. Do I miss something? How can I prevent that wrong behavior? Thanks, Michael.