12-13-2006
datecalc does not handle time, just the date.
This question involves a timestamp in minutes, not seconds. Simply subtracting 30 (rather than 1800) from it would not work shortly after midnight.
Try this:
perl -e '@d=localtime time()-1800; printf "%02d%02d%02d%02d\n", $d[4]+1,$d[3],$d[2],$d[1]'
If you have not installed a recent version of perl, the HP supplied /usr/contrib/bin/perl, which is very old, should work.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hey all,
When you run the 'ls -la' command it'll show you the time and dates of all files/directories. Now what I am trying to do is create a script that will tell me what files haven't been used in over the past 1 month and what the time and date is that the files that haven't been accessed in... (2 Replies)
Discussion started by: merlin
2 Replies
2. UNIX for Dummies Questions & Answers
:confused: I'm not really sure about the default backup date & time in our Unix system and I would like to change it to a convienient time...how do I do that? Please help? (1 Reply)
Discussion started by: EbeyeJJ
1 Replies
3. UNIX for Advanced & Expert Users
in HP-UX how i can measure the response time
and how can i find the maximum IO (1 Reply)
Discussion started by: salhoub
1 Replies
4. UNIX for Advanced & Expert Users
I have script that runs based on time variables passed in the command line. The first command argument is a timer, in seconds, of how often to execute a certain loop in the script. The second command argument is the end time of the script, in military time. Below is an example of the command line:... (1 Reply)
Discussion started by: Nysif Steve
1 Replies
5. Shell Programming and Scripting
Hi,
When we use "ls -l" we are getting like below,
-rw-r--r-- 1 mdskl mds 4161479 Apr 12 14:57 VTTF2008.20080412145748.cc
But i need only modified time and filename only like below,
Apr 12 14:57 VTTF3008.20080412145748.cc
Thanks-:)
Senthil (4 Replies)
Discussion started by: senthil_seera
4 Replies
6. Shell Programming and Scripting
Hi guys,
I know that this topic has been discuss numerous times, and I have search the net and this forum for it.
However, non able to address the problem I faced so far.
I am on Solaris Platform and unable to install additional packages like the GNU date and gawk to make use of their... (5 Replies)
Discussion started by: DrivesMeCrazy
5 Replies
7. Shell Programming and Scripting
Hello All,
I was having a look on threads on the Forum about time calculation but didn't find exactly this issue.
For instance, if we have these 2 dates, begin & end :
20100430235830
20100501000200
Is there anyway, awk, ksh, perl to calculate the difference in sec and get for... (6 Replies)
Discussion started by: rany1
6 Replies
8. Shell Programming and Scripting
This gives:
grep "qprt -o -dp -N 1 -P" printfile.log.1216 |awk '{print $7, $9}' |grep lpc1z
The output like below:
lpc1z /cerner/d_prod/print/ccltemp4235396d030a.dat.tmp.1216075330]
lpc1z /cerner/d_prod/print/ccltemp4235396d036a.dat.tmp.1216075634]
lpc1z... (2 Replies)
Discussion started by: Daniel Gate
2 Replies
9. Linux
Hi,
I have a program called "myProg" which calls two other programs "prog1" and "prog2" with system command in it.
When I type
./myProg
to the terminal, everything is cool. The only things that are missing:
1) I would like to measure the time elapsed when myProg runs (I do not want the... (1 Reply)
Discussion started by: hkullana
1 Replies
10. Programming
Can we select the datetime from oracle database in “hhmmssnnnccyymmdd” format ?
please help to solve this..... (2 Replies)
Discussion started by: Sanal
2 Replies