Answer the question
In order to leave comments, you need to log in
How to store date/time intervals in a database?
I tagged Lara because project on Lara and maybe there are some solutions for it, although the question is probably more about the database.
In general, the task is to store a lot of data, each record must contain time relevance - time fields From and To.
I did not find an example when C can start on one day and BEFORE end on another day, basically one day and only the start and end times are needed.
I thought about how best to store this:
The first option is two timestamp fields. Of the pluses, the selection seems to be easier. Of the minuses, we store the date twice, which is one (more interested in hours)
The second option is three fields: date and hour (from and to). Of the minuses, the selection is more difficult, of the pluses, we store the date once and there should be no confusion.
According to the code, I will often use the condition whether the record falls into these time zones or not, so I wanted to take a normal decision in advance
up: as an option, store only the start time and the number of seconds / minutes until completion. but somehow it doesn't inspire
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