Open Side Menu Go to the Top
Register
Algorithm which traverses hours played between two days Algorithm which traverses hours played between two days

02-10-2018 , 07:03 PM
If you don't know can you point me to a place where I can find the answer? What is the algorithm to determine hours played between two or three days? This has to be broken down so I can enter it as java or other kind of code.

Say I start at 10:00 A. M. on Sept 18 and leave my seat at 3:00 A.M. on Sept 19. How do I compute the hours played.

Not likely, but what if I sit down at 10:00 A.M. on Sept 18 and leave my seat at 3:00 A.M on Sept 21?

Thank you;

Sherman
Algorithm which traverses hours played between two days Quote
02-10-2018 , 07:22 PM
2+2 Programming Forum

Most programming languages have a Date-Time sort of class that enables such computations.
Algorithm which traverses hours played between two days Quote
02-11-2018 , 01:58 AM
Yeah this is basic subtraction between two dates using such a library or class. Is there more to it? Have you sufficiently defined your problem?
Algorithm which traverses hours played between two days Quote
02-12-2018 , 05:05 PM
Yes I didn't define what my goal is. But since I am using PERL I found Time::Interval which does what I want. I wasn't aware of the programming on this forum.

Thank to all;

Sherman
Algorithm which traverses hours played between two days Quote
02-13-2018 , 08:59 AM
If you have a choice, use python instead. Python is better than Perl is just about every way there is.
Algorithm which traverses hours played between two days Quote

      
m