# Time Calculations

## Recommended Posts

I'm trying to write a small time card app to help me keep track of comp time/vacation time. I'm having problems figuring out how to get the math to work properly with standard time format, so I switched to the 24 hour clock. I've also got it stripping the : and what not .. i.e. instead of 9:00pm I get 2100. This worked great until I remembered my time clocks are done on 30 minute increments, and then it hit me. 2130 doesn't mean it's half past the hour. Technically it's only 1/3 into the hour based on the number alone. So I thought to convert any :30 minute blocks using stringinstr to 50's which would fix that problem. However, it's difficult and I was hoping there's an easier time calc function or someone might have an idea to help out.

##### Share on other sites

Valuater made a "work time clock" if you want to do a search for it, I didn't see it on his signature or his site. I'm sure he used some time math in it.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

##### Share on other sites

Valuater made a "work time clock" if you want to do a search for it, I didn't see it on his signature or his site. I'm sure he used some time math in it.

That still in process ronrules ( i added too many options )

however... i dont understand why 2130 is not equal to 21 hours and 30 minutes

try this...

```#include <Date.au3>
MsgBox(0,'',"The time is:" & _NowTime(4))```

8)

##### Share on other sites

First, Thank you for your posts

Second :

I'm not using system time that's why, and I'm converting it from 12:00 to 2100 and using regular normal arithmetic for the rest. That's why 2130 = two thousand one hundred thirty instead of 21hrs 30mins. I'm trying to re-invent the wheel however it sounds like.

Edited by mbiwpeoyc

##### Share on other sites

First, Thank you for your posts

Second :

I'm not using system time that's why, and I'm converting it from 12:00 to 2100 and using regular normal arithmetic for the rest. That's why 2130 = two thousand one hundred thirty instead of 21hrs 30mins. I'm trying to re-invent the wheel however it sounds like.

Hint, convert everything to minutes and work from that. Microsoft uses Monday 1/1/1601 AD at 10:00AM internally as their starting date and calculates the number of seconds from there. Julian dates use the number of days since noon on 1/1/4713 BC.

See the Date.au3 included in your /AutoIT/include/ folder for hints.

Good luck!

##### Share on other sites

Hint, convert everything to minutes and work from that. Microsoft uses Monday 1/1/1601 AD at 10:00AM internally as their starting date and calculates the number of seconds from there. Julian dates use the number of days since noon on 1/1/4713 BC.

See the Date.au3 included in your /AutoIT/include/ folder for hints.

Good luck!

Thank you! I feel semi uhhh... :"> well that sums it up

## Create an account

Register a new account