home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!asuvax!ncar!noao!arizona!sunquest!spades.aces.com!gavron
- From: gavron@spades.aces.com (Ehud Gavron 602-570-2000 x. 2546)
- Newsgroups: comp.os.vms
- Subject: Re: Implimenting "TOMORROW +1: 0:0" from an .EXE
- Message-ID: <11JAN199319201213@spades.aces.com>
- Date: 12 Jan 93 02:20:00 GMT
- References: <1993Jan11.153438.28624@magnus.acs.ohio-state.edu>
- Sender: news@cs.arizona.edu
- Reply-To: gavron@ACES.COM
- Organization: ACES Consulting Inc.
- Lines: 46
- News-Software: VAX/VMS VNEWS 1.4-b1
-
- In article <1993Jan11.153438.28624@magnus.acs.ohio-state.edu>, pat@magnus.acs.ohio-state.edu (Patrick E Plaisted) writes...
- #I have the need to set an AST timer queue entry to fire at, in DCL
- #syntax, "TOMORROW +1:0:0". I've looked through all the LIB$ routines,
- #as well as $bintim and $asctim. Is there a simple way to get a
- #quadword time value set to this so I can stick it into $setimr?
- #My only thoughts on how to do this are:
- #
- # 1. calculate the number of hours to midnight.
- # 2. calculate the number of minutes to midnight.
- # 3. calculate the number of seconds to midnight.
- # 4. use lib$cvt_to_internal_time to convert these values to
- # delta time quadwords.
- # 5. use lib$add_times to add these values to a quadword containing the
- # current time.
- # 6. again using lib$add_times, add 1 hour to this value.
- # 7. finally, call $setimr with the quadword.
- #
- #I think this approach should work, but am I missing something really
- #obvious? Is there an easier way to do this?
-
- 1. Call SYS$GETTIM to get current time in ticks (10ns units)
- 2. Add 144,000,000 to this number
- 24 hrs x 60 min x 60 sec x 100000 ns 144,000,000 ns/day
- ----- ----- ---- =
- hr min sec
- 3. Use SYS$ASCTIM to get this in ascii format in the form
- DD-MMM-YYYY HH:MM:SS.hh
-
- 4. Insert in the 13th position of the string "01:00:00.00"
- 5. Call SYS$BINTIM
-
- (I may be off on the number in #2 but it looks right. I'm
- sure someone will rush to correct me if it isn't.)
-
- #Thanks for all your help,
- #
- #Pat
- #
- #pat@magnus.acs.ohio-state.edu
-
- Ehud
-
- --
- Ehud Gavron (EG76)
- gavron@vesta.sunquest.com
- Don't SANFORIZE me!!
-