[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: Military time (whoops!)



** Reply to message from cld@xxxxxxxx on Wed, 14 Jun 2006 16:11:27 +0000


> Yes, those are chinks in the armor. But, without knowing what the
> post-meridien marker is, how do we know when we're dealing with a PM hour that
> needs to be incremented by 12? That's the missing element in your code (and
> why it returns an incorrect result between noon and midnight).

Ah, so that's your sixth? Then mine was the seventh -- and this is the eighth:

Well, right again. Solution is to go back to using military time, then it has
to be right (hammer on something idiotic like this long enough, and you get
there! we should have contests... winner retires to villa in Vietnam with
White House intern). This looks foolproof to me -- integers only, 24 hour
clock, leading zero (EXCEPT! what does military time say between midnight and
1am? Ah, good: at 0001, it says "0:01" -- so you don't have to loop around to
lead more zeroes -- never need to add more than one zero):

XPLeNCODE v2.0
b-gin [UNTITLED]
{<}SX01,{<}VA$MT{>}{>}[BX_]d mt=1[Q2_]{<}SX02,{<}VA$TM{>}{>}[
BX_]d mt={<}PV01{>}[Q2_]{<}SV01,{027}X{>}{<}SX03,{<}VA|02{>}{
{062}}{<}SV04,{>}{<}CUA,03{>}{<}XS02,01,,05,00{>}{<}IF{<}VA{021}0
5{>}>0{>}{<}SX04,{<}IS04{>}+{<}IS05{>}{>}{<}EI{>}{<}SX02,{<}I
S00{>}{>}{<}LBA{>}{<}IF{<}VA|04{>}<4{>}{<}SX04,"0"+{<}IS04{>}
{>}{<}EI{>}{<}PR@04{>}{<}EX{>}[cr|lf]
-nd
XPLeNCODE

-----------------------------
Robert Holmgren
holmgren@xxxxxxxx
-----------------------------