git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Fix approxidate() to understand more extended numbers

From
Junio C Hamano <junkio@cox.net>
Date
Sep 29, 2006, 07:09 UTC
Message-ID
<7vslibno88.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0609282330440.3952@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 16 quoted lines
>> > I think 12pm is correct, but 12am probably isn't (12am should _subtract_ 
>> > 12, while 12pm does _not_ add 12).
>> 
>> But you have "if (hour > 0 && hour < 12)" in both am and pm so
>> assignment to tm would not trigger...
>
> That's not the point.
>
> If you write
>
> 	12:30 am
>
> you really _should_ subtract 12, leaving you with 0:30. We don't. So we 
> end up with a 24-hour time of 12:30, which is obviously _pm_, and wrong.
>
> And "12 am" or "12 pm" doesn't work at all.

Ah, that's what you meant. My brain a bit too tired from the day job tonight X-<.

Show 6 quoted lines
>> > That said, I have a rice cooker that avoids the problem by saying "0:10 PM" 
>> > for ten minutes past midday ;)
>> 
>> You eat rice?
>
> Ok, is it just me, or is that just a very odd question?

Having rice cooker implied eating the stuff regularly and I just did not expect that from a north european. Just showing my ignorance -- I've never been to Europe.

Previous: Linus TorvaldsNext: Johannes Schindelin
Message 7 of 9 in “Clean up approxidate() in preparation for fixes”
  1. Linus TorvaldsSep 28, 2006
  2. Fix approxidate() to understand more extended numbersLinus Torvalds, Sep 28, 2006
  3. Morten WelinderSep 29, 2006
  4. Linus TorvaldsSep 29, 2006
  5. Junio C HamanoSep 29, 2006
  6. Linus TorvaldsSep 29, 2006
  7. Junio C HamanoSep 29, 2006
  8. Johannes SchindelinSep 29, 2006
  9. Linus TorvaldsSep 29, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.