From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,5c7411e3cf60a1d7 X-Google-Attributes: gidf7344,public X-Google-Thread: 1164f8,5c7411e3cf60a1d7 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1994-01-05 21:27:42 PST Xref: gmd.de comp.os.vms:38157 comp.sys.dec:12709 Path: gmd.de!newsserver.jvnc.net!howland.reston.ans.net!pipex!uunet!news.claremont.edu!nntp-server.caltech.edu!SOL1.GPS.CALTECH.EDU!CARL From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick) Newsgroups: comp.os.vms,comp.sys.dec Subject: Re: need help using RTL time functions Date: 6 Jan 1994 04:53:07 GMT Organization: HST Wide Field/Planetary Camera Distribution: world Message-ID: <2gg5fj$80u@gap.caltech.edu> References: Reply-To: carl@SOL1.GPS.CALTECH.EDU NNTP-Posting-Host: sol1.gps.caltech.edu In article , ah301@yfn.ysu.edu (Jerry Sy) writes: =I am writing a simple Vax C program to calculate time difference, =but the RTL LIB$ functions does not seem to be returning to me =the correct results. can anybody tell me what I am doing wrong ? = =My code is shown below. I know that the difference should be 30 minutes =but the RTL function gives me 24 minutes as the difference between =7:30 and 7:00! = =please email replies if possible. =thanks in advance = =JERRY = = =/* INCLUDE FILES */ =#include stdio =#include stdlib =#include time =#include string =#include descrip =#include libdtdef = =unsigned long result,operation,delta_min; =typedef struct dsc$descriptor_s desctype; =desctype dateA,dateB; =unsigned long qDateA,qDateB,qDateDiff; A lonwgword is two words (32 bits); a quadword is 4 words (64 bits [2 longwords]). Change this declaration to: unsigned long qDateA[2],qDateB[2],qDateDiff[2]; and your problem will be fixed -------------------------------------------------------------------------------- Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL Disclaimer: Hey, I understand VAXen and VMS. That's what I get paid for. My understanding of astronomy is purely at the amateur level (or below). So unless what I'm saying is directly related to VAX/VMS, don't hold me or my organization responsible for it. If it IS related to VAX/VMS, you can try to hold me responsible for it, but my organization had nothing to do with it.