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

Re: Military time (whoops!)



From: "Robert Holmgren" 
> Oof! You're right, and there are two other things that nag (I can't quite say
> "insistently", but...): What if user has wiped out his SE:# separator string,
> or somehow omitted the colon or period or whatever is used with MT=0 to
> separate hours from minutes? And in a national version such as EuroScript
> (believe it or not, I know some Euroscript users), what if post-meridien isn't
> "PM"?

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). We can't
rely on significant digits, because we don't know if the first one or two digits are hours.
Hmmmm....

BTW, my sixth way failed to account correctly for midnight and noon. Should be:

XPLeNCODE v2.0
b-gin [UNTITLED]
{<}SX01,{<}VA$TM{>}{>}{<}SV02,{027}S{>}{<}XS01,02,02,,03{>}{<
}IF{<}VA{021}03{>}<1{>}{<}SX04,{<}IS03{>}{>}{<}SX03,{<}VA@03{032}
1{>}{>}{<}IF{<}IS04{>}{240}"A"&{<}PV02{>}>11{>}{<}SV02,00{>}{
<}EI{>}{<}IF{<}IS03{>}{240}"P"{>}{<}IF{<}PV02{>}<12{>}{<}SX02
,{<}PV02{>}+12{>}{<}EI{>}{<}EI{>}{<}EI{>}{<}SX01,{<}IS02{>}+{
<}IS03{>}{>}{<}IF{<}VA|01{>}<4{>}{<}SX01,"0"+{<}IS01{>}{>}{<}
EI{>}{<}PR@01{>}{<}EX{>}[cr|lf][cr|lf]
-nd
XPLeNCODE


--
Carl Distefano
cld@xxxxxxxx