Answer the question
In order to leave comments, you need to log in
How to save information in the database for calculating the delivery time, taking into account the mode of operation?
There is information about the working hours:
warehouse
base
from Monday to Friday from 9 to 18
changes
Saturday from 10 to 15
from January 1 to January 9, 2018 work from 10 to 15
office
basic
from Monday to Saturday from 11 to 16
changes
January 1, 2018 day off
January 2, 2018 from 11 to 12
delivery service
basic
from Monday to Friday from 09 to 21
and
the delivery time from the warehouse in hours
,
for
example, 15 hours calculate delivery time using SQL queries
and at the same time:
1) it would be possible to set the basic mode of operation for a certain period (from 01/01/2018 to 06/25/2018) or for an indefinite time (from 06/06/2018);
2) it would not be necessary to constantly add information to the database about the known basic mode of operation from paragraph 1 for a new period;
3) the operating mode could change for a certain period (May 1 is a day off, from January 1 to January 9, the operating mode is from 10 to 15);
4) according to these data, it would be easy to obtain the date and time of delivery for a certain date and time, taking into account the basic and changed modes of operation, which will begin in the near future, the simultaneous operation of the warehouse and office and will then be calculated within the framework of the delivery service.
For the example above for January 1, 2018, it should be:
The nearest time of work of the office and warehouse is January 2, 11:00
15:00 within the framework of the service working hours starting from January 2, 2018, 11:00 will be January 3, 15:00.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question