Subject: bug#49748: 27.2; format-time-string returns 30 minutes for the value zero

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 28 Jul 2021 17:27:47 +0200

Hosein <[email-masked]> 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