Sign in to follow this  
Followers 0
HeXetic

Calculating Minutes Spent

6 posts in this topic

I'm busy writing a task management tools that functions as a time sheet. The users enters in all the details and it gets stored in a SQLite database. Two of the details that the users enters is the time they Started a task and the Time they Ended the task. What I need to do is get the amount of minutes spent on the task.

For example if a user started a task at 09:00 and ended it at 10:25 I need the program to return 85 Minutes.

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

like a time & motion study, i hate them.

Hi,

Simply use Timer

;Here user start his task
  $Timer=TimerInit();Start to count time
  
;User continue his task and script can continue too
;User has finished his task !
  $Difference=TimerDiff($Timer);Get difference between now and start of task
  Msgbox(64,"Timer","User have take : "&$Difference&" seconds for his task")
Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

like a time & motion study, i hate them.

Yeah exactly like that.

Hi,

Simply use Timer

;Here user start his task
  $Timer=TimerInit();Start to count time
  
;User continue his task and script can continue too
;User has finished his task !
  $Difference=TimerDiff($Timer);Get difference between now and start of task
  Msgbox(64,"Timer","User have take : "&$Difference&" seconds for his task")
This is definitely one way of doing it but I was hoping there would be some kind of function to get the amount of minutes based on what the user has already entered.

Share this post


Link to post
Share on other sites

Hi,

Simply use Timer

;Here user start his task
   $Timer=TimerInit();Start to count time
   
;User continue his task and script can continue too
;User has finished his task !
   $Difference=TimerDiff($Timer);Get difference between now and start of task
   Msgbox(64,"Timer","User have take : "&$Difference&" seconds for his task")
The user will enter start and end time.

You will use _DateDiff()

Share this post


Link to post
Share on other sites

Thanks very much weaponx, works perfectly.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0