Questions tagged [datetime-comparison]
102 questions
1
vote
1 answer
How to compare system's current LocalDateTime with input String date and time
I am trying to compare the current system's time and date with an input String time and date. I am using LocalDateTime.now() to get the systems current time, and also using DateTimeFormatter to format it as dd-MM-yyyy HH:mm pattern
static…

anon
- 25
- 3
1
vote
0 answers
Comparing two dictionary with DateTime Key and DateTime Value to get the available doctor Slots in C#
I have listed some doctor slots which are stored in a Dictionary as DateTime Key as Start Time and DateTime Value as End Time. I have another Dictionary with DateTime Key and DateTime Value to contain some booked or already scheduled times. Now how…

mnu-nasir
- 1,642
- 5
- 30
- 62
1
vote
1 answer
compare an array of dates to check date overlap in an easy way in java-script
I would like to check any date conflicts occurring in my date array. I have an array like…

Jomol MJ
- 671
- 1
- 6
- 23
1
vote
2 answers
Comparing and Subtracting Dates
I'm looking to find a way to determine if a time in a column falls within 7 days of another date in that same column.
Say this is my data frame-
dic = {'firstname':['Rick','Rick','Rick','John','John','John','David',
…

Delto
- 137
- 8
1
vote
2 answers
compare a np array of datetime with a single datetime in python
I am trying to compare an array of datetime to a single datetime
tt = np.array([['1993-09-01T00:00:00.000000000',
'2005-12-01T00:00:00.000000000'],
['1992-07-01T00:00:00.000000000',
'2009-05-01T00:00:00.000000000']],…

AAA
- 695
- 1
- 7
- 21
1
vote
1 answer
How to check minimum and max times with LocalDateTime java ie minimum 10:00 and max time 10:30
I am new to java and I am having a problem with checking if a time falls/fits into a space of time, ie 10:00-10:30.
The idea is to find out if the time is between 10:00 and 10:30
below is my code:
LocalDateTime timecheck =…

Musa
- 35
- 7
1
vote
2 answers
Comparing two datetime strings
I have two DateTime strings. How would I compare them and tell which comes first?
A = '2019-02-12 15:01:45:145'
B = '2019-02-12 15:02:02:22'

Pgcsn Monde
- 13
- 1
- 5
1
vote
2 answers
Comparing two joda DateTime instances across EST EDT
I have two DateTime instances, A and B, where:
DateTime A = new DateTime(2018, 11, 4, 1, 00, 0).plusHours(1);
DateTime B = new DateTime(2018, 11, 4, 2, 00, 0);
println("A: "+ A +", "+ A.getChronology() +", ms "+ A.getMillis());
println("B: "+ B +",…

Norcal
- 11
- 2
1
vote
3 answers
Check if the time is within the min and max range
I don't know what's happening here: I need to return true if the current time is between a given range, ex: now is 15:45:00 and is between 12:00:00(min) and 18:00:00(max), but this method is doing it wrong:
private boolean verifyIfInside(String max,…

Rafael Araujo
- 15
- 5
1
vote
1 answer
How to compare 2 dates using Momentjs diff
I'm trying to compare 2 dates. If the date received is before the current day (Today) I have to delete the attribute @availabilityBeginDate but if the date received is after the current day I have to save it. I'm writing it in CoffeeScript.
I want…

Nicolas Guerin
- 356
- 2
- 18
1
vote
3 answers
Python datetime comparison is incorrect in case of compare two time like: 12:00 and 11:59
so below example of code:
>>> from datetime import datetime
>>> future = datetime.strptime('12:00', '%I:%M')
>>> past = datetime.strptime('11:59', '%I:%M')
>>> future < past
>>> True # expected False, because '12:00' > '11:59'
>>> past_2 =…

SergeySD
- 83
- 1
- 2
- 7
1
vote
2 answers
Android Phone Silent on Time Comparison
all my code is in timer and it tik every 2 seconds
I have 3 different times
1) Time from the time picker(sTime).
2) Get Current time of my phone(cTime).
3) Expiry Time - (for creating range between timepicker's time and expiry time) (rTime).
I want…

Imran
- 39
- 9
1
vote
4 answers
Comparing DateTimes in C# producing unexpected results
Im trying to compare if a runtime variable is within now and one minute from now. Here is the code:
if (RunTime.ToUniversalTime() >= now.ToUniversalTime() &&
RunTime.ToUniversalTime() < now.AddMinutes(1).ToUniversalTime())
{
//Do Stuff…

user3839756
- 793
- 1
- 9
- 22
1
vote
1 answer
considering the use case of user selecting reverse time interval in android app
The android app will notify user only between the time interval user selects.
Settings will have two timepickers to store TIME1 and TIME2
I am planning to store the time in INT format as suggested by following link
link --> Store time in int data…

UzUmAkI_NaRuTo
- 565
- 3
- 8
- 20
1
vote
2 answers
Compare and filter data with date in MM/DD/YYYY format from current date using using new Date() while subtracting new Date() from user input value
Trying to compare the new Date(today's date) in 2015-02-21T21:48:48.137Z format with date in MM/DD/YYYY format which is my json data. I would like to filter all the data before today's days based on user input based on number of day's user…

Don
- 305
- 4
- 17