Hi,
It is possible to calculate the difference in milliseconde between 2 dates and 2 hours?
For example:
Hour Format 24H
01/09/2010 11:45 and 01/10/2010 02:13
Thanks
Alex
Moderator: Neosoft Support
.Convert time1 to seconds since midnight
SubStr "[Time1]" "1" "2" "[H]"
SubStr "[Time1]" "4" "2" "[M]"
SubStr "[Time1]" "7" "2" "[S]"
Math "([H]*3600)+([M]*60)+[S]" "0" "[T1]"
.Convert time2 to seconds since midnight
SubStr "[Time2]" "1" "2" "[H]"
SubStr "[Time2]" "4" "2" "[M]"
SubStr "[Time2]" "7" "2" "[S]"
Math "([H]*3600)+([M]*60)+[S]" "0" "[T2]"
.Convert date1 to days
DateToNum "[Date1]" "m/d/y" "[D1]"
.Convert date2 to days
DateToNum "[Date2]" "m/d/y" "[D2]"
.subtract date2 from date1 and convert to seconds
Math "([D2]-[D1])*86400" "0" "[ElapsedDaysAsSeconds]"
.subtract time2 from time1
Math "[T2]-[T1]" "0" "[ElapsedSeconds]"
.combine elapsed days as seconds and seconds
Math "[ElapsedDaysAsSeconds]+[ElapsedSeconds]" "0" "[ElapsedTime]"
.display the results
AlertBox "Result" "Elapsed time is: [ElapsedTime] seconds"
Math "1000*[ElapsedTime]" "0" "[milltime]"
Return to NeoBook Action Commands
Users browsing this forum: No registered users and 2 guests