The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Difference in day-hours-minutes-seconds format Sreejith_VK Shell Programming and Scripting 7 02-27-2008 02:04 AM
crontab every 2 minutes, 24 hours and once a week Bobafart UNIX for Dummies Questions & Answers 6 05-17-2007 10:08 AM
how to display time in minutes n seconds... santy Shell Programming and Scripting 1 08-23-2006 10:18 AM
get last 5 minutes' log from log file? fedora Shell Programming and Scripting 5 07-19-2006 04:49 PM
C Shell Script to convert a number into minutes Ringo Shell Programming and Scripting 1 08-07-2003 01:24 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-08-2005
Vozx Vozx is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 12
Convert minutes to hours, minutes, seconds

How would you convert lets say a 1000 minutes to hours, minutes, seconds
  #2 (permalink)  
Old 12-09-2005
aniseed's Avatar
aniseed aniseed is offline
Registered User
  
 

Join Date: Dec 2005
Location: Mumbai, India
Posts: 23
If you are converting minutes to hh:mm:ss, seconds will always be 00. Hours can be obtained as (input minutes/60) and the minutes can be calculated with (input minutes - hours*60)

Code:
#!/usr/bin/ksh

((hour=$1/60))
((min=$1-$hour*60))
echo $hour:$min:00
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:26 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0