Top "Datediff" questions

Date-difference will give difference in the number of days, months, years etc.

Undefined date_diff()

I'm trying to use date_diff(): $datetime1 = date_create('19.03.2010'); $datetime2 = date_create('22.04.2010'); $interval = date_diff($datetime1, $…

php datediff
Oracle equivalent to SQL Server/Sybase DateDiff

We are now using NHibernate to connect to different database base on where our software is installed. So I am …

sql sql-server oracle sybase datediff
DateDiff years into decimals

I have two dates in which i would like to find the number of years between them, however i would …

sql-server-2008 tsql datediff
How to calculate difference between two datetime in ElasticSearch

I'm working with ES and I need a query that returns the difference between two datetime (mysql timediff), but have …

elasticsearch datediff
Using DATEDIFF in T-SQL

I am using DATEDIFF in an SQL statement. I am selecting it, and I need to use it in WHERE …

tsql datediff
Is it possible to set start of week for T-SQL DATEDIFF function?

I use DATEDIFF function to filter records added this week only: DATEDIFF(week, DateCreated, GETDATE()) = 0 and I noticed what it's …

tsql date datediff
Calculate month difference in Joda Time

At the 4th line of code (ignore whitespace & comments) and beyond I'm calculating the month difference between 2 dates. This …

java date jodatime datediff
Why does the difference between 30 March and 1 March 2020 erroneously give 28 days instead of 29?

TimeUnit.DAYS.convert( Math.abs( new SimpleDateFormat("dd-MM-yyyy HH:mm:ss").parse("30-03-2020 00:00:00").getTime() - new SimpleDateFormat("dd-MM-yyyy HH:…

java date java-7 datediff
python: difference of two timedate strings

I have two date strings (taken from user input and can vary greatly) s1 = '2011:10:01:10:30:00' s2 = '2011:10:01:11:15:00' I …

python datetime datediff
PHP get days between start-date and end-date

If I have two variables $startDate="YYYYmmdd" and $endDate="YYYYmmdd", how can I get the number of days between them …

php date datediff