Answer the question
In order to leave comments, you need to log in
How to calculate the working time in a date range?
There are two unix timestamps:
$start = 123456789; // в прошлом
$finish = time(); // текущее
Answer the question
In order to leave comments, you need to log in
What are some ideas?Very easy - you need to calculate the number of working days not including the first and last and multiply by the number of seconds between 07:00:00 and 22:45:00. Then, if the first day is a working day, add the number of seconds between the start of that day (or 07:00:00 if the timestamp is earlier) and 22:45:00. Then, if the last day is a working day, add the number of working seconds in it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question