Path: utzoo!attcan!uunet!husc6!mailrus!iuvax!bsu-cs!cfchiesa
From: cfchiesa@bsu-cs.UUCP (Christopher Chiesa)
Newsgroups: comp.os.vms
Subject: Re: Thanks for the replies, and Quadword Date Comparisons
Summary: Date comparisons...
Message-ID: <3379@bsu-cs.UUCP>
Date: 5 Jul 88 19:04:34 GMT
References: <8806281323.AA07688@mitre-bedford.ARPA>
Organization: CS Dept, Ball St U, Muncie, Indiana
Lines: 32

In article <8806281323.AA07688@mitre-bedford.ARPA>, mhg@MITRE-BEDFORD.ARPA (Mark H. Granoff) writes:
> 
> My application stores date/time stamps for certain events in quadword
> format.  I would like to have commands that use qualifiers like
> /SINCE=date and /BEFORE=date (like the VMS DIRECTORY command, etc).
> My question is: What's the best way to do date comparison like this?
> I thought of a couple ways:
> 
>      1.	Call LIB$SUBX with the two dates.  Based on the sign of the
> 
>      2.	Use LIB$DAY (I think), which returns the day number of a given
> 
> Is there a better way?  Are these two solutions reasonable,
> interchangable, did I miss something in a manual or something, or ....?

This may generate more questions than it answers, but...


   ... can't you just compare your quadwords directly?  Now wait, I don't
mean using a nonexistent "CMPQ" instruction; I mean, using the appropriate
combination of two CMPL instructions, is it not the case that the date/time
quadwords simply INCREASE as time goes by?  I.e. that the date/time quad-
word of a LATER date will always be greater than that for an EARLIER date?
I've done a little experimenting along this line and this has always seemed
to be the case.

Chris Chiesa


-- 
UUCP: !{iuvax,pur-ee,uunet}!bsu-cs!cfchiesa 
cfchiesa@bsu-cs.UUCP