10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I calculate in my bash script the different between two timestamps in seconds. The next step would be to get the difference in minutes, and there is my Problem:AnzahlUeberstunden=$(( $(date -d "$JAHR-$MONAT-$TAG $ArbeitEnde" +%s) - $(date -d "$JAHR-$MONAT-$TAG... (6 Replies)
Discussion started by: Chaos_Lord
2. UNIX for Beginners Questions & Answers
Hi, please help with below time conversion to minutes.
one column values:
2 minutes 16 seconds 420 msec
43 seconds 750 msec
0 days 3 hours 29 minutes 58 seconds 480 msec
11 seconds 150 msec
I need output in minutes(total elapsed time in minutes) (2 Replies)
Discussion started by: ramu.badugula
3. Shell Programming and Scripting
I have two dates in below format, how would I find the hours difference between the two dates. Im using AIX and ksh.
Current date : Wed May 17 14:34:41 SGT 2017
File date : Thu Apr 27 20:52:41 SGT 2017 (3 Replies)
Discussion started by: simpltyansh
4. Shell Programming and Scripting
I am working on script where I need to add hours,minutes or seconds in the time.Time is not the current but it could be future time.I thought I can store that time in variable and add hours.minutes or second but I am not able to add that in the time that is stores in a variable.
Time... (9 Replies)
Discussion started by: anuragpgtgerman
5. Shell Programming and Scripting
I have a problem. I am working on a Call Detail Report system. Come to find out the phone switch does not report in seconds. It is a 5 digit field that reports h:mm:ss
The problem is I have 1-5 digit numbers
Ie 1 = 1 second and should be reported as 0:00:01
22 should be 0:00:22
321 should be... (5 Replies)
Discussion started by: truecall
6. Shell Programming and Scripting
I need to run a script every five minutes and it should run between 07-15 hours all days.
How i can achieve this...
i tried like this
*/5 07-15 * * * /scripts/CreateFtpData.sh
It throws an error... (1 Reply)
Discussion started by: aemunathan
7. Shell Programming and Scripting
I searched and found a few relevant posts (here and here - both by porter, on the same day (?)) however both are just a do while loop, I need to check a file date and compare it to the current time.
I would like it to say if file 'test' is more than 12 hours old than "right... (3 Replies)
Discussion started by: phdeez
8. UNIX for Dummies Questions & Answers
can someone please check my answers for the crontabs I am making
1. how would I set up a crontab tab executes every 2 minutes each and every day of the week?
answer: 2 * * * * /path/to/file.pl <-- is this correct?
2. how would I set up a crontab that executes every 24 hours at 2am?... (6 Replies)
Discussion started by: Bobafart
9. Shell Programming and Scripting
may i know how to display time in minutes and seconds(may be milliseconds and even smaller that ) in shell scripts.... (1 Reply)
Discussion started by: santy
10. Shell Programming and Scripting
How would you convert lets say a 1000 minutes to hours, minutes, seconds (1 Reply)
Discussion started by: Vozx
TIMETRANS(1p) User Contributed Perl Documentation TIMETRANS(1p)
timetrans - Converts time into time
timetrans [units-options] [-count]
timetrans converts time from one type of unit to another. If any of the units options are specified, then timetrans will convert those
time units into the number of seconds to which they add up. If given the count option, timetrans will convert that number of seconds into
the appropriate number of weeks, days, hours, minutes, and seconds. The converted result is printed out. Units options cannot be
specified in the same execution as the count option, and vice versa.
timetrans is intended for use with DNSSEC-Tools, for calculating a zone's expiration time.
The converted value of each unit is totaled and a single result printed.
Count of seconds to convert to seconds.
Count of minutes to convert to seconds.
Count of hours to convert to seconds.
Count of days to convert to seconds.
Count of weeks to convert to seconds.
The specified seconds count is converted to the appropriate number of weeks, days, hours, minutes, and seconds.
Count of seconds to convert to the appropriate set of units.
timetrans has the following miscellaneous options.
Displays the version information for timetrans and the DNSSEC-Tools package.
Example 1: Converting 5 days into seconds
$(42)> timetrans -days 5
Example 2: Converting 2 weeks into seconds
$(43)> timetrans -w 2
Example 3: Converting 8 days and 8 hours into seconds
$(44)> timetrans -d 8 -hours 8
Example 4: Converting 1 week, 1 day, and 8 hours into seconds
$(46)> timetrans -w 1 -days 1 -h 8
Example 5: Converting 14 weeks, 4 days, 21 hours, 8 minutes, and 8 seconds into seconds
$(47)> timetrans -w 14 -d 4 -h 21 -m 8 -s 8
Example 6: Converting 720000 seconds into time units
$(48)> timetrans -c 720000
1 week, 1 day, 8 hours
Example 7: Converting 1814421 seconds into time units
$(49)> timetrans -c 1814421
3 weeks, 21 seconds
Example 8: Converting 8888888 seconds into time units
$(50)> timetrans -c 8888888
14 weeks, 4 days, 21 hours, 8 minutes, 8 seconds
Copyright 2004-2012 SPARTA, Inc. All rights reserved. See the COPYING file included with the DNSSEC-Tools package for details.
Wayne Morrison, email@example.com
perl v5.14.2 2012-06-21 TIMETRANS(1p)