GNU bug report logs - #49748
27.2; format-time-string returns 30 minutes for the value zero

Previous Next

Package: emacs;

Reported by: Hosein <naghdbishi <at> riseup.net>

Date: Tue, 27 Jul 2021 16:36:02 UTC

Severity: minor

Tags: notabug

Found in version 27.2

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Hosein <naghdbishi <at> riseup.net>
Cc: 49748 <at> debbugs.gnu.org
Subject: bug#49748: 27.2; format-time-string returns 30 minutes for the value zero
Date: Wed, 28 Jul 2021 17:27:47 +0200
Hosein <naghdbishi <at> riseup.net> writes:

> Hi, I expected (format-time-string "%M:%S" 0)) to return "00:00" but
> since I live in a GMT+3:30 time zone it returns "30:00".
>
> Same is true for
> (format-time-string "%Y, %D, %H, %M, %s, %z%S" 0)
> which returns:
>
> "1970, 01/01/70, 03, 30, 0, +033000"

This is how it's designed to work:

(format-time-string "%H:%M:%S" 0)
=> "01:00:00"

here.  If you want the string formatted in universal time, say:

(format-time-string "%H:%M:%S" 0 t)
"00:00:00"

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 3 years and 293 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.