Sign in to follow this  
Followers 0
mbiwpeoyc

Time Calculations

6 posts in this topic

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.

Thanks for your time !

Share this post


Link to post
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.


[center]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.[/center]

Share this post


Link to post
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)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

First, Thank you for your posts B)

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 this post


Link to post
Share on other sites

First, Thank you for your posts B)

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! :o

Share this post


Link to post
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! :o

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

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