Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Struts
covert secs to mm:ss format
Lalit Vora
Ranch Hand
Posts: 37
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
can anyone guide me please how to convert secs in duration field in resultset to display as mm:ss
Example. I am getting duration as 180 i want to show in report as 03:00
Thanks
Merrill Higginson
Ranch Hand
Posts: 4864
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
public static String convertSecondsToMinutesAndSeconds(int secsInput) { NumberFormat formatter = new DecimalFormat("00"); int minutes = secsInput / 60; int seconds = secsInput % 60; return minutes + ":" + formatter.format(seconds); }
[ July 11, 2006: Message edited by: Merrill Higginson ]
Merrill
Consultant,
Sima Solutions
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Weblogic Timeout Attributes
Oracle Timestamps and java.
If you find the Segway too pedestrian.....
Math Prob - Equation Rearrange
A Short Neurological Test
More...