Ah you're right, confirmed it in the source. Very strange indeed! Not sure why it's done that way...
If you wanted you could look into uComponents Dates extensions, it has DateWithinLastDays(string, int) that returns true/false. Or if you're just looking to improve readability, you could of course create a variable called $numDays and just multiply by 24 * 60 in your DateDiff call.
Difference between dates
Hi..
If there another way to get the difference between two dates in days than using DateDiff ?
It seems only to have the parametres: "s", "m" or "y" so I have to set the 14 days in minutes:
Bjarne
Hi Bjarne,
That's strange, can you not use "d" for days? I thought you'd be able to use any of the intervals documented here.
-Tom
Yes, that's strange.. if I use d instead of m it just return 0 on every product.
When I use m for minutes it return numbers like: 50143, 12569, 12568... and so on..
So it doesn't seem to be an available parameter in that method..
Bjarne
Ah you're right, confirmed it in the source. Very strange indeed! Not sure why it's done that way...
If you wanted you could look into uComponents Dates extensions, it has DateWithinLastDays(string, int) that returns true/false. Or if you're just looking to improve readability, you could of course create a variable called $numDays and just multiply by 24 * 60 in your DateDiff call.
-Tom
Yes very.. it's a common scenario where you want to use dates.. but of course I can just multiple number of days with 24*60 ..
Thanks, that might be useful.. but in this case it's okay with that fix..
Bjarne
is working on a reply...