date-difference Questions
15
I'm looking for a way to use DateTime to parse two dates, to show the difference.
I want to have it on the format: "X years, Y months, Z days".
For JS, we have momentjs library and following code:...
However asked 3/6, 2020 at 10:13
5
Solved
I want to subtract dates in 'A' from dates in 'B' and add a new column with the difference.
df
A B
one 2014-01-01 2014-02-28
two 2014-02-03 2014-03-01
I've tried the following, but get an erro...
Sandrocottus asked 2/3, 2014 at 19:47
8
Solved
I have the following query :
select CONVERT(varchar(12), DATEADD(MILLISECOND, DateDiff(MILLISECOND, '2014-08-04 10:37:28.713','2014-11-04 08:21:17.723'), 0), 114)
When I execute this, I get the ...
Oaxaca asked 4/11, 2014 at 7:56
19
Solved
I want to compare two dates for my Android application, but I got a really weird issue.
For example:
If I set the back in the past date to 127 days ago:
this.dateEvent = System.currentTimeMillis...
Ctenophore asked 27/4, 2014 at 13:5
28
Solved
I'm wondering if there is some new and awesome possibility to get the amount of days between two NSDates in Swift / the "new" Cocoa?
E.g. like in Ruby I would do:
(end_date - start_date).to_i
Platt asked 13/7, 2014 at 13:58
2
Solved
I have to do a difference between dates and return the number of days.
the format of the dates is as follows:
12/9/2011 12:00:00 AM
Does anyone know how to perform the difference without usin...
Angy asked 6/7, 2016 at 7:16
4
Solved
I have an ArrayList including several number of time-stamps and the aim is finding the difference of the first and the last elements of the ArrayList.
String a = ArrayList.get(0);
String b = Array...
Peay asked 11/2, 2013 at 10:17
6
Solved
I am looking for solution how to select number of days between two dates without weekends and public holidays.
So far I have this:
SELECT evnt.event_id,
evnt.date_from,
evnt.date_to,
DATEDIFF(...
Always asked 14/1, 2016 at 16:28
14
Solved
I know there are lots of questions on SO about how to get Dates in Java, but I want an example using new Java 8 Date API. I also know about the JodaTime library, but I want a method without relying...
Intima asked 18/11, 2014 at 23:6
7
Solved
I'm trying to get the difference between two datetimes and return it as a datetime. I've found examples using diff but I can't seem to get it right.
$timein = date("Y-m-d H:i:s");
$timeout =...
Stomatic asked 28/3, 2013 at 17:51
3
Solved
I have two LocalDates declared as following:
val startDate = LocalDate.of(2019, 10, 31) // 2019-10-31
val endDate = LocalDate.of(2019, 9, 30) // 2019-09-30
Then I calculate the period between th...
Fern asked 26/10, 2019 at 18:45
1
Suppose I have :
Employee model which has startDate as its property variable and Promotion model has promotionDate.
I want to find out for how long employee has worked until his promotion fo...
Cheshvan asked 3/3, 2019 at 9:55
2
How can I get the difference in days between 2 timestamp fields in Google Big Query?
The only function I know is Datediff which only works in Legacy SQL but I'm in Standard SQL.
For example: th...
Magnet asked 15/5, 2018 at 13:28
2
I am using java 8 and I'm trying to calculate the amount of months between two OffsetDateTime objects. What is the best way to do this?
Technology asked 30/4, 2018 at 9:0
2
Solved
I would like to create a new column in my dataset, which is a difference in years between today and a another column already in the dataset, filled up with dates.
the code above:
df['diff_years'...
Deeannadeeanne asked 2/3, 2018 at 14:49
1
Solved
In Joda, we can calculate years between 2 Datetime using
Years.between(dateTime1, dateTime2);
Is there any easy way to find years between 2 instants using the java.time API instead without much ...
Pecos asked 15/11, 2017 at 4:52
4
Solved
Calculating the number of days between 1900-01-01 and a date after 1918-03-24 using Joda-Time seems to give an off-by-one result.
Using Java 8 java.time gives the correct result. What is the reaso...
Kalahari asked 10/10, 2017 at 9:29
1
Solved
I'm looking for a solution to calculate the months between two date. I think joda or java8 time can do it. But when I compare them I found something really weird.
import java.text.ParseException;...
Perni asked 15/9, 2017 at 5:47
4
Solved
I have got the following code:
DateTime start = DateTime.Now;
Thread.Sleep(60000);
DateTime end = DateTime.Now;
and I would like to calculate the difference in minutes between start and en...
Tonry asked 18/7, 2017 at 13:18
2
Solved
I am trying to compare received date of an email(date object) with a date(String) in a JSONObject. The two dates are going to be of different Timezones with a difference of 1 hour.
My scenario is...
Lifer asked 23/6, 2017 at 13:5
3
Solved
I wonder if anyone has seen this, and if there is a solution, or if I'm just not doing something right. I'm trying to get the hours difference between now and a "created date" in a database record ...
Dyslexia asked 7/12, 2016 at 0:36
1
Solved
I want exact Year, Month and Day elapsed between two dates.
DateTime startDate = new DateTime(1974, 8, 15);
DateTime endDate = DateTime.Now.ToLocalTime();
I wish to find Number of Years, ...
Capitulate asked 6/7, 2016 at 1:28
1
Solved
Below query is my sql server query and I want it to convert it into hive query:
select DATEDIFF([minute], '19000101', '2013-01-01 10:10:10')
Lankester asked 8/11, 2015 at 10:45
1
I have a dataframe:
ID DATE WIN
A 2015/6/5 Yes
A 2015/6/7 Yes
A 2015/6/7 Yes
A 2015/6/7 Yes
B 2015/6/8 No
B 2015/8/7 Yes
C 2015/5/15 Yes
C 2015/5/30 No
C 2015/7/30 No
C 2015/8/03 Yes
I want to a...
Fauna asked 16/9, 2015 at 14:52
6
Solved
I want to calculate the difference between two date/time in java using Date and Calendar classes. The format that I have is "2012-01-24 12:30:00 PM".
I have implemented my own method and also goog...
Cordiality asked 25/1, 2012 at 10:12
1 Next >
© 2022 - 2025 — McMap. All rights reserved.