Sponsored Content
Top Forums Shell Programming and Scripting Converting seconds to minutes Post 303042537 by nezabudka on Saturday 28th of December 2019 07:42:10 AM
Old 12-28-2019
Hi
look at this way
Code:
declare -i AnzahlUeberstunden
AnzahlUeberstunden=$(date -d "$JAHR-$MONAT-$TAG $ArbeitEnde" +%s)-$(date -d "$JAHR-$MONAT-$TAG $NormalesArbeitsEnde" +%s) #"tags" are not needed
AnzahlUeberstunden=AnzahlUeberstunden/60 #dollar sign is not needed
echo $AnzahlUeberstunden
34

Please note there should not be spaces around the minus sign

Last edited by nezabudka; 12-28-2019 at 09:18 AM..
These 2 Users Gave Thanks to nezabudka For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert minutes to hours, minutes, seconds

How would you convert lets say a 1000 minutes to hours, minutes, seconds (1 Reply)
Discussion started by: Vozx
1 Replies

2. Shell Programming and Scripting

how to display time in minutes n seconds...

Hi all, 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
1 Replies

3. HP-UX

a simple way of converting a date in seconds to normal date

Hi all! I'm working on a HPUX system, and I was wondering if there is a simple way to convert a date from seconds (since 1970) to a normal date. Thanks (2 Replies)
Discussion started by: travian
2 Replies

4. Shell Programming and Scripting

Difference in day-hours-minutes-seconds format

Hi experts, I am reading two log files and passing dates as output to a txt file. Code is given below: echo "Start Time:" >> Report.txt cat start.log | while read LINE1 do echo $DATE1 >> Report.txt done echo "End Time:" >> Report.txt cat end.log | while read LINE2 ... (7 Replies)
Discussion started by: Sreejith_VK
7 Replies

5. Shell Programming and Scripting

Converting past date to seconds

Need a little help developing a ksh script. Have read through Perderabo's datecalc routine and it does not seem to fit the function I am looking for. Basically what I am trying to do is find any file (in a specific directory) that was created within the last five minutes. I am not a programming... (3 Replies)
Discussion started by: synergy_texas
3 Replies

6. Shell Programming and Scripting

How to split numeric value into hours:minutes:seconds

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
5 Replies

7. Shell Programming and Scripting

Add or Subtract the hours,minutes or seconds in the the time variable

Hello All, 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
9 Replies

8. Shell Programming and Scripting

Converting seconds to time

I have a list of time spans in seconds, and want to compute the time span as hh:mm:nn I am coding in bash and have coded the following. However, the results are wrong as "%.0f" rounds the values. Example: ftm: 25793.5 tmspan(hrs,min,sec): 7.16 429.89 25793.50 hh: 7 mm: 10 ss:... (2 Replies)
Discussion started by: kristinu
2 Replies

9. Shell Programming and Scripting

Converting time format as Integer to seconds

Hello, How can we convert date like format 20181004171050 in seconds ? I can able to convert till date but failing for HHMMSS. date -d "20181004" "+%s" output as 1538596800 . But when i add hhmmss it is failing date -d "20181004172000" "+%s" result Invalid date Kindly guide. Regards (16 Replies)
Discussion started by: sadique.manzar
16 Replies

10. UNIX for Beginners Questions & Answers

How to convert days hours minutes seconds to minutes?

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
2 Replies
OIDUA(1)						      General Commands Manual							  OIDUA(1)

NAME
oidua - audio file metadata lister SYNOPSIS
oidua [options] directory [...] DESCRIPTION
lists meta data of audio files. What information and how it is presented is customizable. It is possible to format output in csv, html, xml or for human beings. OPTIONS
-B, --bg COLOR Set HTML background color -D, --date Display datestamp header --debug Output debug trace to stderr -e, --exclude DIRECTORY Exclude directory from search -f, --file FILE write output to file -h, --help Display help message -H, --html HTML output --ignore-bad Don't list files that cause Audiotype failure -i, --ignore-case Case-insensitive directory sorting -I, --indent N Set indent to N -m, --merge Merge identical directories Basedirs with identical names are merged. This Means that all their subdirs are considered being subdirs of a single directory, and therefore sorted and displayed together. If there are duplicate names among the subdirs then those are also merged. -o, --output STRING Set output format to STRING Anything enclosed by brackets is considered a field. A field must have the following syntax: [TAG] [TAG,WIDTH] [TAG,WIDTH,SUFFIX] [TAG,SUFFIX] TAG is any of the following characters: a list of bitrates in Audiolist compatible format b bitrate with suffix (i.e. 192k) B bitrate in bps d depth; distance from respective basedir f number of audio files (including spacers) l length in minutes and seconds L length in seconds m time of last change M time of last change in seconds since the epoch n directory name (indented) N directory name p profile P full path q quality s size with suffix (i.e. 65.4M) S size in bytes t file type T bitrate type: ~ mixed files C constant bitrate L lossless compression V variable bitrate WIDTH defines the exact width of the field. The output is cropped to this width if needed. Negative values will give left aligned output. Cropping is always done on the right. SUFFIX lets you specify a unit to be concatenated to all non-empty data. Other interpreted sequences are: [ [ ] ] new line tab character Unescaped brackets are forbidden unless they define a field. Note: If you have any whitespace in your output string you must put it inside quotes or otherwise it will not get parsed right. -q, --quiet Omit progress indication -s, --strip Strip output of field headers and empty directories -S, --stats Display statistics results -t, --time Display elapsed time footer -T, --text COLOR Set HTML text color -V, --version Display version -w, --wildcards Expand wildcards in basedirs REPORTING BUGS
Report bugs to Sylvester Johansson <sylvestor@telia.com> SEE ALSO
http://oidua.suxbad.com/ AUTHOR
oidua was written by Sylvester Johansson and Mattias Paeivaerinta This manual page was written by Erik Wenzel <erik@debian.org> for the Debian GNU/Linux system (but may be used by others). May 15, 2007 OIDUA(1)
All times are GMT -4. The time now is 10:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy