Raised This Month: $ Target: $400
 0% 

time print


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-15-2020 , 20:47   Re: time print
Reply With Quote #1

Quote:
Originally Posted by Sanjay Singh View Post
I want to print in hrs and min if it crossed 60mins.

According this code it will print hours but min will keep increasing.
Use the following code for calculating hours, minutes, and seconds:
Code:
iSeconds = 12345 // your time source in seconds
iHours = iSeconds / 3600
iMinutes = iSeconds % 3600 / 60
iSeconds = iSeconds % 60


Quote:
Originally Posted by Natsheh View Post
When dividing an odd number always use floats AKA double variables then round the number to get an integer.
Uh . . no. In this case, we are not trying to get fractional values.
__________________

Last edited by fysiks; 01-15-2020 at 20:53.
fysiks is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 17:03.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode