I´m sure this question is simple, but I can´t figure it out.
I´m making a comparison using different times. Say I want to know if something has ended after 17:00.
If I test with xx.endtime>=17:00 it doesn´t work. So I made a small workaround. I made a systemsetting called systemsetting.time1700 and assigned the time 17:00.
And when I make this comparison xx.endtime>=systemsetting.time1700 it works.
But it really feels stupid. So since I´m obvioulsy is missing out on something here can anyone explain this?
/Rem
Timeformat question
Thanks Tom, that worked, but isn´t there a way to compare the actual time without splitting it up into hours and minutes.
The problem now is that if I compare with 17 it goes all the way to 17:59 (and in my calucation that is not OK, and if I end at 16 I will miss one hour).
So, my workaround is still doing a better job but why can I not just type 17:30 in the rule? That is how I type it in the form.
/Rem
The problem now is that if I compare with 17 it goes all the way to 17:59 (and in my calucation that is not OK, and if I end at 16 I will miss one hour).
So, my workaround is still doing a better job but why can I not just type 17:30 in the rule? That is how I type it in the form.
/Rem
Rem,
I THINK the reason you can't use 17:30 is that AwareIM is similar to Excel in that it stores time info in formats that are different from what you see. Hence, the reason for functions to manipulate them.
Your workaround works because you are comparing 2 stored numbers that are stored in the same manner.
Tom
I THINK the reason you can't use 17:30 is that AwareIM is similar to Excel in that it stores time info in formats that are different from what you see. Hence, the reason for functions to manipulate them.
Your workaround works because you are comparing 2 stored numbers that are stored in the same manner.
Tom
-
- Posts: 304
- Joined: Fri Jun 22, 2007 8:26 pm
Rem,
If you are doing your calculation(s) in real time then you can look for the time/hour/minute as needed using your server's time. Of course if your server is hosted in another area of the country that may not work for you...
Example;
IF CURRENT_HOUR < 17 AND IF CURRENT_MINUTE < 15 Then do whatever
The Current Hour return an integer constant 0-23 while Current Minute returns 0-59
Hope that helps,
Christopher
If you are doing your calculation(s) in real time then you can look for the time/hour/minute as needed using your server's time. Of course if your server is hosted in another area of the country that may not work for you...
Example;
IF CURRENT_HOUR < 17 AND IF CURRENT_MINUTE < 15 Then do whatever
The Current Hour return an integer constant 0-23 while Current Minute returns 0-59
Hope that helps,
Christopher
Well, actually I´m calculating time spent on consulting a client (customer). We have different rates depending on when the job is done.
So if the job starts at 15:30 and ends at 23:00, the customer should pay for 1,5 horus daytime (to 17:00) and 5 hours evening time and 1 hour nighttime. So for every calculation I have two parameters involving both hours and minutes and 4 different timerates, before 8 oclock, between 8 and 17, between 17 and 22 and after 22. So it gets a bit complicated.
And if you cant use the actual time, like 17.15 it gets nearly imposible.
If I should write this in normal code I should have used variables and started to fill them with time and in the end have four variables which each should have hold the time for mornig, day, evening and night, but as I understand Aware doesn´t work the same way as a programming language?
Sounds easy, but thats the difference between the human brain and computers.
/Rem
So if the job starts at 15:30 and ends at 23:00, the customer should pay for 1,5 horus daytime (to 17:00) and 5 hours evening time and 1 hour nighttime. So for every calculation I have two parameters involving both hours and minutes and 4 different timerates, before 8 oclock, between 8 and 17, between 17 and 22 and after 22. So it gets a bit complicated.
And if you cant use the actual time, like 17.15 it gets nearly imposible.
If I should write this in normal code I should have used variables and started to fill them with time and in the end have four variables which each should have hold the time for mornig, day, evening and night, but as I understand Aware doesn´t work the same way as a programming language?
Sounds easy, but thats the difference between the human brain and computers.
/Rem
-
- Posts: 304
- Joined: Fri Jun 22, 2007 8:26 pm