Questions tagged [date-comparison]

This tag refers to the process of comparing two or more dates with one another.

Use this tag for any questions related to date comparison.

327 questions
-1
votes
1 answer

PHP date comparison giving unintended results

I am formatting dates to American style format mm/dd/yyyy (without time) and comparing the dates but not getting expected results. echo $startDate ; // 09/14/2018 echo $nextDate ; // 03/08/2019 echo $stopDate ; // 03/08/2019 The above…
rolinger
  • 2,787
  • 1
  • 31
  • 53
-1
votes
1 answer

To check current date is less than expiration date

I'd like to check if the system date (e.g. the current date) is before an expiry date before opening my software. I have written the following code, however it throws a NumberFormatException. Why might this be happening? public class dateController…
XYZ
  • 15
  • 1
  • 6
-1
votes
3 answers

how to return a list of objects from arraylist when passed two dates in java?

Am using following code to return photo objects from arraylist between start and end date (dates are in YYYY-MM-DD string format). if no such objects, it should return empty list. How can i modify to get the result? There are two parts of code.…
Jim Ye
  • 77
  • 8
-1
votes
3 answers

Compare Date is Greater than in C#

I'm trying to check if the passing variable date is greater than a static date which I have included in the code and currently trying to use the following code, private String LastPayDate { get { string foo; …
Jani
  • 1
  • 1
  • 1
-1
votes
1 answer

Finding the trend in disease conditions in R

I have a dataset in which I have several patients, their disease activity status and abundance of specific bacteria as below: **Patient** **DiseaseActivity** **Bacteria** 15 Severe 0.6704 15 Quiescent 0.0350 24 Quiescent 0.0137 24 Quiescent…
Lothlorian
  • 55
  • 2
  • 9
-1
votes
2 answers

Java DateComparison

I use the code below to see if my input date (format mm/dd/yyyy HH:mm:ss) falls within the range of startDate and endDate. I use compareTo() in this logic. But with the format mm/dd/yyyy, it compares the month alone and prints output in "MYLOGIC…
Megu
  • 5
  • 4
-1
votes
1 answer

Date comparison with comparison operators

i have a php code where i am trying to compare dates and the condition is if the currentdate is <= frmdate then query rows has to be inserted in array whereas the problem now happening is that it inserts only rows which are less than and not which…
md gouse
  • 527
  • 1
  • 6
  • 22
-1
votes
2 answers

Use compareTo for year,month and day.. Java

I wanna sort the dates out on the screen but the thing is, when I use compareTo method, I can only use it with one of the Date attributes: Year, month or day.. not all of them. This is a custom class, not java.util.Date class. I am required to sort…
the feels
  • 107
  • 1
  • 7
-1
votes
1 answer

Compare two dates in Angular

I want to compare two dates. I'm new in Angular The two dates are in same format mm/dd/yyyy
{{CurrentDate | date:'MM/dd/yyyy' }}
{{cmp_actl_del_date }}
these three are my dates. I want to check cmp_actl_del_date > the…
robins
  • 1,668
  • 6
  • 33
  • 69
-1
votes
1 answer

Comparing two NSDates returning 0 or equal

I am facing problem in comparing two NSDates. I am not getting proper value, where I am going wrong. First I compared using compare method of NSDate which was returning 0 and next I tried to convert it into float by calling timeIntervalSince1970…
-1
votes
2 answers

how to compare between two dates in php

I have two dates start and end that are already booked
-1
votes
3 answers

How can I compare the date with today's date using UNIX timestamp values in PHP?

I've following variable containing date in MM-DD-YYYY format. I want to compare this date with today's date. If the date containing in a variable is greater than the today's date I want to echo "Error" and if it is less than or equal to today's date…
PHPLover
  • 1
  • 51
  • 158
  • 311
-1
votes
1 answer

Comparing dates in php from the database

How to compare two dates in php. I got an array of dates from the database and I want it to compare with todays date. I have something like this. $d['dd'] = 10; $d['mm'] = 12; $d['yy'] = 13; Now I have done Something like this: $date =…
modon
  • 241
  • 3
  • 7
  • 14
-2
votes
3 answers

Comparing two dates in jquery script

I'm trying to compare two same dates in the browser console and getting the result as false. I don't understand how is it comparing as both the dates are the same? $(function() { var d1 = new Date("01-12-2001"); var d2 = new…
SPnL
  • 338
  • 4
  • 15
-2
votes
1 answer

Compare Dates Using JDateChooser

I have two boxes of JDateChooser and I would like to make the following comparison: the user will inform the first date when it finishes entering the second date, I make a comparison consisting of: if the second date is greater than or equal to…
WillGreco
  • 29
  • 2
  • 10
1 2 3
21
22