Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cica!sol.ctr.columbia.edu!sdsu!ucsdhub!hp-sdd!hplabs!hpda!hpcuhb!hpsqf!hpopd!andyc From: andyc@hpopd.HP.COM (Andrew Cunningham) Newsgroups: comp.unix.questions Subject: Re: Re^2: Getting UNIX time from the shell Message-ID: <4930003@hpopd.HP.COM> Date: 21 Jun 89 08:44:12 GMT References: <1343@cbnewsh.ATT.COM> Organization: HP OPD, Pinewood UK. Lines: 22 Usinh HP-UX 6.5 on a 9000/360, using date '+%H:%M:%S' prints the date, so use command substitution to get this into the variable you want us e: time=`date +%H:%M:%S` (sh) or set time = `date +%H:%M:%S` (csh) to get each component: hrs=`date +%H` min=`date +%M` sec=`date +%S` Hope this helps! Andrew Cunningham Disclaimer: I am NOT speaking as an employee of HP. Andrew Cunningham, HP Software Engineering Systems Division, Pinewood E-mail: andyc@hpopd hplabs!hpopd!andyc