Re: [PATCH] pretty: Provide a strict ISO8601 date format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 29, 2014 at 11:41:39AM -0700, Junio C Hamano wrote:
> You feed tz/100 to "%+03d:" (the "sign and hour" part of the
> timezone).  What if tz is -30, i.e. less than an hour but still a
> negative offset?  tz/100 would be zero and tz % 100 would be -30.
> 
>     tz = -30;
>     printf("%+03d:%02d", tz / 100, abs(tz % 100));
> 
> would show what?

+00:30 because zero can't be negative in two's complement arithmetic.

The "-30 / 100 = 0" part didn't click for some reason.  Sorry for the
noise.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]