Path: utzoo!utgpu!water!watmath!clyde!bellcore!decvax!ucbvax!pasteur!ames!think!bloom-beacon!gatech!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!iuvax!bsu-cs!cfchiesa From: cfchiesa@bsu-cs.UUCP (Sir Xetwnk) Newsgroups: comp.os.vms Subject: Re: Printing file age via DCL Summary: Adding/subtracting time values in DCL Message-ID: <2123@bsu-cs.UUCP> Date: 16 Feb 88 09:30:37 GMT References: <880208133256.00001457.HBKK.83@WYOCDC1> Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 32 In article <880208133256.00001457.HBKK.83@WYOCDC1>, ZSYJKAA@WYOCDC1.BITNET (Jim Kirkpatrick 307 766-5303) writes: > I have a simple problem nobody here seems to be able to solve (we're fairly > new to VMS) which is, how to display a file's age via DCL. I can get > the revision date and time via F$FILE_ATTRIBUTES, but how do I subtract this > (which is a character string) from the current date and time (another string) > and end up with something meaningful (such as DELTA time format)? I can't > see how to do it via F$CVTIME though I tried F$CVTIME(-RDT) and all it gave > me was midnight of today. I can't believe this would be difficult in DCL > but it sure isn't obvious to me! I thought I had the complete answer for you, but after adapting what I had to your purposes, I find that I only have HALF the answer. I confess to some difficulty with the DD-MMM-YYYY portion of the time fields, but the following should suffice to subtract the HH:MM:SS portions... It may be useful for SOMETHING... $ r_time = f$cvtime(f$file("''p1'","RDT"),,"time") $ c_time = f$cvtime(,,"time") $ write sys$output "Interval = ",f$cvtime("''r_time'-''c_time'",,"time") $ exit Chris Chiesa Ball State University Muncie, IN <><><><><><><><><><><><><><><><><><><><><><><><><><><><> Chris Chiesa <><><><><> <> {ihpn4|seismo}!{iuvax|pur-ee}!bsu-cs!cfchiesa <> <> cfchiesa@bsu-cs.UUCP <> <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>