ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Conversion to hours and seconds???

Post new topic  Reply to topic
 Conversion to hours and seconds??? « View previous topic :: View next topic » 
Author Message
LH33
PostPosted: Tue Feb 07, 2006 12:52 pm    Post subject: Conversion to hours and seconds??? Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

I want to calculate a Duration and format it as follows: HHH:MMSS

The input is an interval (number of widgets) and an estimated time integer in seconds. I want to multiply the number of widgets by the estimated time to get the total seconds (number 1 below). Then I want to divide the total seconds by 3600 to get the hours and remainder (number 2 below). How can I extract the remainder (the decimal portion) so I can then multiply it by 60 to get the remaining seconds (number 3 below)?

Example:

1. Number of widgets = 14 X 720 (estimated time) = 10080 seconds
2. 10080 seconds / 3600 = 2.8 (2.8 hours)
3. .8 * 60 = 48 minutes

Final Format = 002:4800 (2 hours and 48 minutes)

Thanks for any help you can provide!
Back to top
View user's profile Send private message
wschutz
PostPosted: Tue Feb 07, 2006 1:07 pm    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Well. if its broker V6, you can use the FORMAT option on the CAST function to generate your final format. (and the EXTRACT function to pull out the hours and minutes for the calculation)
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
LH33
PostPosted: Tue Feb 07, 2006 1:11 pm    Post subject: Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

I am on Version 5.04 - will your suggestion work on this version? If not, any other suggestions?

Thanks!
Back to top
View user's profile Send private message
JT
PostPosted: Tue Feb 07, 2006 1:35 pm    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

If I understand you correctly, I think you're looking for the MOD function.
Back to top
View user's profile Send private message
LH33
PostPosted: Tue Feb 07, 2006 2:27 pm    Post subject: Reply with quote

Master

Joined: 21 Nov 2002
Posts: 200

Yes, thank you! the MOD function worked.
Back to top
View user's profile Send private message
wschutz
PostPosted: Tue Feb 07, 2006 4:06 pm    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Next time, I'd read the question a little closer ...
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
JT
PostPosted: Tue Feb 07, 2006 4:41 pm    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

.......but please don't stop providing solutions that use new V6 features/functions.
Back to top
View user's profile Send private message
wschutz
PostPosted: Tue Feb 07, 2006 4:44 pm    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)


_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Conversion to hours and seconds???
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.