Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!aurora!amelia!ames!pasteur!cory.Berkeley.EDU!leres From: leres@cory.Berkeley.EDU (Craig Leres) Newsgroups: comp.mail.mh Subject: Re: BUGFIX: times like "12:?? am" and "12:?? pm" parsed incorrectly Message-ID: <1037@pasteur.Berkeley.Edu> Date: 26 Feb 88 02:45:19 GMT References: <7170@agate.BERKELEY.EDU> Sender: news@pasteur.Berkeley.Edu Reply-To: leres@ucbarpa.Berkeley.EDU (Craig Leres) Lines: 65 There are definiately bugs in parsetime(); unfortunately, Brent's change breaks the parsing of military time. Appended are the changes I recommend people make to zotnet/tws/dtimep.lex. Also included is a gratuitous spelling fix. Craig ------ *** ./zotnet/tws/dtimep.lex.orig Thu Feb 25 18:23:21 1988 --- ./zotnet/tws/dtimep.lex Wed Feb 24 13:41:21 1988 *************** *** 20,26 **** may (may) jun (jun(e)?) jul (jul(y)?) ! aug (aug(est)?) sep (sep(tember)?) oct (oct(ober)?) nov (nov(ember)?) --- 20,26 ---- may (may) jun (jun(e)?) jul (jul(y)?) ! aug (aug(ust)?) sep (sep(tember)?) oct (oct(ober)?) nov (nov(ember)?) *************** *** 175,188 **** tw.tw_sec = CVT2; BEGIN Z; } ! {D}:{D}{w} | {D}:{D}{w}am{w} { tw.tw_hour = CVT2; cp++; tw.tw_min = CVT2; BEGIN Z; } {D}:{D}{w}pm{w} { ! tw.tw_hour = CVT2 + 12; cp++; tw.tw_min = CVT2; BEGIN Z; } --- 175,196 ---- tw.tw_sec = CVT2; BEGIN Z; } ! {D}:{D}{w} { ! tw.tw_hour = CVT2; cp++; ! tw.tw_min = CVT2; ! BEGIN Z; ! } {D}:{D}{w}am{w} { tw.tw_hour = CVT2; cp++; + if (tw.tw_hour == 12) + tw.tw_hour = 0; tw.tw_min = CVT2; BEGIN Z; } {D}:{D}{w}pm{w} { ! tw.tw_hour = CVT2; cp++; ! if (tw.tw_hour != 12) ! tw.tw_hour += 12; tw.tw_min = CVT2; BEGIN Z; }