home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.hypercard
- Path: sparky!uunet!caen!no-name-nib.med.umich.edu!user
- From: nick.waanders@med.umich.edu (Nick Waanders)
- Subject: Re: HELP: Counting days...
- Message-ID: <nick.waanders-291292085612@no-name-nib.med.umich.edu>
- Date: Tue, 29 Dec 92 08:57:58 EST
- Organization: University of Michigan
- Followup-To: comp.sys.mac.hypercard
- References: <1992Dec29.123417.1@vax1.tcd.ie>
- Nntp-Posting-Host: no-name-nib.med.umich.edu
- Lines: 21
-
- >
- > How do I count days in HyperCard?
- >
- It is pretty easy to convert dates and times using the CONVERT command. If
- two dates are converted to seconds, you can then divide the difference by
- the number of seconds in a day (which by the way is 24 hours of 60 mins of
- 60 seconds). For example...
-
- put "5/14/92" into checkoutdate
- put "5/21/92" into returndate
- convert checkoutdate to seconds
- convert returndate to seconds
- answer "Book returned after"&&(returndate-checkoutdate)/(24*60*60)&&"days."
-
- Another convert option which is useful is dateitems, which amoung other
- things gives you the day of the year (1-365). However, this approach would
- have trouble when the year changes.
-
- Nick Waanders
- Orthopaedic Research Labs
- University of Michigan
-