Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public static hourCount TimeCalcHr(DateTime InputStart, Datetime InputEnd)
- {
- hourCount hours = new hourCount();
- Long secondsBetween = InputEnd.getTime() - InputStart.getTime();
- double totalHours = math.ceil(Integer.valueOf(secondsBetween / 60000 / 60));
- for(integer counter =0; counter <= totalHours; counter++)
- {
- //some logic here to figure out of this hour is day or night
- boolean isDay = true;
- if(isDay)
- {
- hours.dayHours++;
- }
- else
- {
- hours.nightHours++;
- }
- }
- return hours;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement