home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / hypercar / 4678 < prev    next >
Encoding:
Text File  |  1992-12-29  |  1.2 KB  |  34 lines

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