Questions tagged [datetime-comparison]

102 questions
0
votes
2 answers

Comparing Date and Time with three days ahead using Java-8 LocaldateTime

I have a java application where in the User can not modify the order after a specific date and time .eg.the user can not modify the order after the 3rd day by 12:00 PM ,say if the order was placed on Nov 9th ,the user will not be able to modify the…
user964819
  • 343
  • 3
  • 6
  • 24
0
votes
3 answers

Check if time is between two values - always return 0

I have a function to show an alert if time is between two values. Eg: start = 07:00:00 end = 17:00:00 assert start != null; int from = Integer.valueOf(start.replace(":", "")); assert end != null; …
RGS
  • 4,062
  • 4
  • 31
  • 67
0
votes
2 answers

How to check time is between two time only night in android

in my android app I have the condition if selected time is greater than 11:00 PM and 07:00 AM then there will be extra charges. it applicable only at night. currently, my code is work correctly but when I am selecting a time in day condition is…
Dipak
  • 99
  • 1
  • 11
0
votes
1 answer

not able to catch particular time slot in java

I was working in some project, in which it was required to test the particular time if between 08 PM to 12 AM time slot. I converted the dates to long and check the difference. For all other time slots I was getting positive output. But when I…
J. Doe
  • 69
  • 7
0
votes
4 answers

Java how to compare LocalTime using only hours, minutes and seconds

I want to compare if 2 LocalTime are equal, but only using the hours, minutes and seconds, not with all the data of the variable, like milliseconds. How can I accomplish that?
0
votes
1 answer

Compare between different time and then and display error message android

I have mostly spent 1 day for just comparing two times but no worth result until now. I am basically trying to compare between two different times which I want to avoid storing data id the first time less than the second time but I couldn't. In…
0
votes
1 answer

How to compare date type in java

SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { Date startDate = format.parse(prodPeakChargeFormList.get(1).getStartDate()); Date endDate = format.parse(prodPeakChargeFormList.get(1).getEndDate()); if…
k.sh
  • 5
  • 4
0
votes
2 answers

How to compare the current date with string date stored in array?

I am trying to compare the current date with the date stored in the array, but I am not able to compare the date using if condition. I use this code to compare the date: DateFormat TO = new SimpleDateFormat("yyyy-MM-dd "); Today =…
selva surya
  • 103
  • 9
0
votes
0 answers

Java Android: how to compare current time to a calculated time?

Good day. I am trying to create a quiz answer form where there is a time limit. The timelimit is defined by the teacher in hours and minutes. It is then added to the date-time where the student has taken the quiz. int HOUR = getHour(); int MIN =…
RFA
  • 771
  • 1
  • 5
  • 14
0
votes
1 answer

Query data between two dates

I need to get data between two dates from the Mongodb data that hosted in online server. I tried this code and it's working good in my Localhost (local data & live data). But when I uploaded the app in online and it's not working properly in…
0
votes
1 answer

WEB API how to compare date time with additional time span

I have created a WEB API in which I am sending a serial number and a date time. In result it gives me the last/latest record value. What I have done Below is my controller code var dateTime = dt.ToString(); // dt is the user sent date time var…
Moeez
  • 494
  • 9
  • 55
  • 147
0
votes
1 answer

Cut the date if there is overlapping

I have a List with two dates value and I have the 'filterFromDayStart' and filterToDayEnd which presente for example the following date 20.06.17 00:00:00 and 20.06.17 23:59:59 Now I want to cut row[15] or row[16] if there is overlapping…
TheBook
  • 1,698
  • 1
  • 16
  • 32
0
votes
2 answers

Validate Time Range using jQuery

I have page with 2 textfields (start time and end time) i am using HTML5 time element, now i want to validate start time is always lesser than end time, i am currently using below script to validate function checkTimings(source, argument) { …
Abbas
  • 4,948
  • 31
  • 95
  • 161
0
votes
1 answer

Compare two time continously in android

I want to run Async Task in Android every intervals. my interval is = { 15 min , 30 min , 1 hour ....etc Depending on the users' choice. When I start my application then I want to fetch my current time and after every n interval I want to execute…
Skand kumar
  • 93
  • 1
  • 1
  • 9
0
votes
1 answer

NSComparisonResult is not working as expected for 10 PM and above

I need to compare two times in Swift and using NSComparisonResult I could get correct result until it comes to time between 10 PM - 11:59 PM. It shows opposite result for these times. Anyone know what's the issue with this? Below is sample code and…
Pandurang Yachwad
  • 1,695
  • 1
  • 19
  • 29