Date-difference will give difference in the number of days, months, years etc. between any two calendar dates. (synonyms in stackoverflow.com: datediff, date-diff, date-difference)
Questions tagged [date-difference]
446 questions
-2
votes
2 answers
get current datetime in minutes and convert datetime (d.m.Y H:m) to minutes Javascript
Please i need some help in javascript or jQuery :
how to get current date and time to minutes?
i have a datetime in that format : 'd/m/Y H:m' (example 25/12/2016 22:35) in input . how to get it and convert it to minutes ? and make difference…

AmenzO
- 409
- 7
- 19
-2
votes
2 answers
DateDiff Javascript - Return alert if one date greater than another
function CheckDates() {
var ExtendToDate = GetFieldValue("Extend to Date");
var LastLeaverDate = GetFieldValue("ARP Mandatory Exit Date");
var difference = moment.duration(moment(LastLeaverDate, 'MM-DD-YYYY') -
moment(ExtendToDate,…

Lee S
- 17
- 6
-2
votes
1 answer
DateAdd( on parameter
Hello I'm currently writing a report based on weekly sales,
I've attained my current figure correctly and that works with my @FirstdayofWeek
and @LastDayOfWeek parameters
and im now trying to replicate it for my Previous week, as you know previous…

James Chaggar
- 15
- 6
-2
votes
3 answers
Filter time values that are a set period either side of a specified time
Given a specified time value and an interval value:
Specified Time: 13:25:00
Interval Value: 00:20:00
How can I filter the following table of values to return times that are the specified Interval either side of the Specified…

Amin AmiriDarban
- 2,031
- 4
- 24
- 32
-2
votes
3 answers
How to check whether user logged in or not in today using MySQL query
I have table like this; I captured every thing:
id, username, email, last_login
I want to know if user has logged in today or not. Please help me in single query

sv.sasi
- 7
- 4
-2
votes
2 answers
User dynamically enters 2 dates and gets days as difference
What I am trying to achieve is basically the user will enter 2 dates and get back the difference in days. I have seen other related questions in SO but none answer my question.
Following is my code:

Caffeine Coder
- 1,869
- 1
- 17
- 35
-2
votes
1 answer
How to get the Month from date string in sql server
As stated in the Title of the question , i have different days in different accounts, How to get the date part of these

Adham
- 63,550
- 98
- 229
- 344
-3
votes
1 answer
How to get only the time difference, ignoring the date difference, between two DateTimeOffset in C#?
i am using c# and I need to get the difference between two DateTimeOffset() ignoring the year, month and day witch mean get the difference between the hour, minutes and the seconds.
lets say this is my start date "startDate":…

han na
- 7
- 2
-3
votes
3 answers
Java Difference between current date and past date in Years, Months, Days, Hours, Minutes, Seconds
I know this has been asked on here many times previously, but I'm haven't been able to find anything specific to my case. I'm trying to find the difference between the current datetime and a previous datetime, each with the format yyyy-MM-dd…

SVill
- 331
- 5
- 22
- 55
-3
votes
2 answers
DateTime returning Total days instead of Remaining days in PHP
I have a MySQL DB which stores Warranty dates. The values are Start_Date and End_Date, I'm trying to calculate the Days of Warranty remaining.
Example:
Invoice 0001
Warranty Start (2018-12-01)
Warranty End (2019-01-11)
Output: Warranty Expires in…
user2293381
-3
votes
1 answer
MYSQL How to perform custom month difference between two dates in MYSQL?
My requirement is to compute the total months and then broken months separately between 2 dates (ie first date from table and second date is current date). If broken months total count is > 15 then account it as one month experience and if its les…

Malathy
- 337
- 5
- 14
-3
votes
2 answers
user defined datetime input in java
i wanted to take an input of date and time in the below format and need to calculate the time difference between two, can anyone suggest how to take below string as input and calculate the time difference.
user defined datetime input in java
String…

Roopesh
- 1
- 3
-3
votes
1 answer
Convert Date to the same format as another Date
I have a requirement like, the date difference should be calculated from an input date and the current date in Talend java platform.
In that case I can use
TalendDate.diffDate(date1, date2) : long method, where date1 and date2 are of type…

Sekar
- 11
- 3
-3
votes
1 answer
Find the difference between two dates (Inclusive of start and end date) in Java
I need to find the difference between two dates in Java and the difference should be inclusive of start and end date. I tried using below piece of code but it is not including start and end date.
long diffDays = Days.daysBetween(new…

Vijay
- 19
- 1
- 5
-3
votes
2 answers
How to COUNT with given month and year only
I have two string like below.
How do I get difference between them in PHP?
I tried code below
StartWork),date_create($experience[$i]->EndWork))->format("%a days"); ?>

bramadwitra
- 97
- 1
- 12