Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP: date between date

I have two dates:

10-11-2010 and 17-11-2010

Now i would like to SELECT all rows with the dates between those two.

How can I do that?

like image 453
Karem Avatar asked Nov 17 '10 09:11

Karem


People also ask

How do I find the date between two dates?

We can get the dates between two dates with single method call using the dedicated datesUntil method of a LocalDate class. The datesUntill returns the sequentially ordered Stream of dates starting from the date object whose method is called to the date given as method argument.

How can I get second date between two dates in PHP?

Show activity on this post. $timeFirst = strtotime('2011-05-12 18:20:20'); $timeSecond = strtotime('2011-05-13 18:20:20'); $differenceInSeconds = $timeSecond - $timeFirst; You will then be able to use the seconds to find minutes, hours, days, etc.

How can I compare two time in PHP?

php $start = strtotime("12:00"); $end = // Run query to get datetime value from db $elapsed = $end - $start; echo date("H:i", $elapsed); ?>


1 Answers

its very simple using between in where clause , read more

select * from mytable where date between '10-11-2010' and '17-11-2010'
like image 189
Haim Evgi Avatar answered Nov 15 '22 12:11

Haim Evgi