Questions tagged as 'dateinterval'

4
answers

Calculate date difference and start these days

I would like to calculate the difference of two dates and print all dates between them, for example: $data_inicio = new DateTime("08-02-2018"); $data_fim = new DateTime("10-03-2018"); ($dateInterval = $data_inicio->diff($data_fim); echo $da...
asked by 21.03.2018 / 13:12
2
answers

Checking date within a range in SQL

I need to check in my SELECT whether the e.DataTrm field is between 30 and 90 days from today's date. How to make condition in CASE? SELECT e.NmrCnt AS [Contrato] ,e.NmrSerie AS [Serie] ,e.DataAfr AS [Data Aferiçã...
asked by 21.09.2016 / 20:49
1
answer

How to include dateInterval property inside a variable

After you get the time difference between two input time fields (see this question ), I do not know how I can put these values inside variables, so I can use them in other functions. The var_dump of variable $intervalo (...
asked by 17.04.2015 / 04:09
2
answers

How to get the integer value of "days" from a DateInterval

How do I get the days value of a DateInterval through the date_interval_format() method? I tried the following, but it did not work: $var = date_interval_format($diferenca, '%days');     
asked by 08.07.2015 / 14:06