Questions tagged [datetime-comparison]

102 questions
0
votes
1 answer

Improvement to this code to compare 2 time in format (HH:MM:SS)

I wrote some code to compare 2 time in string format (HH:MM:SS). var time = new Date(); var current_time_str = time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds(); var deadline= "16:00:00" //hh:mm:ss if ( (current_time_str) >…
guagay_wk
  • 26,337
  • 54
  • 186
  • 295
0
votes
1 answer

Linq with date comparision not working

I need to compare two date ranges against a records list using LINQ, and for some reason I'm stuck badly. I am receiving date in string format which I am converting to DateTime. I know there is data within the specific date range in database so I…
K.Z
  • 5,201
  • 25
  • 104
  • 240
0
votes
1 answer

Get the currently online employees using MySQL

I have employees working in different shifts and weekdays. Their shift details are saved in workshifts table in the following format. WeekDay - Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday StartTime - 24Hr format. For ex, 05:00…
Uma Ilango
  • 968
  • 4
  • 16
  • 31
0
votes
1 answer

Comparing datetime values in SQL server 2008

I'm facing a challenge in comparing datetime values in SQL server 2008. I want to select only those rows from the table 'Plane_Allocation_Table' where the column 'To_Date' which is of type DATETIME is less than today's date and time (which I…
0
votes
1 answer

How to use Joda-Time DateTimeComparator

I want to compare 2 dates without the time, some posts in SO suggest to use Joda-Time API, but I don't understand how to use Joda-Time. I can't find any post that include how to declare, what package to be imported. and what does method…
Maya Nastasya
  • 197
  • 2
  • 16
0
votes
1 answer

Display no of days between two calendars

I want to calculate the difference between two dates and display it on the text box when TODATE is selected. Automatically difference between FROMDATE and TODATE will display. Note: Those calendars are user defined controls.
0
votes
2 answers

lmFit model datasets requirements

I am very new to R and try to analyze a few expression array data. For the gene expression analysis, we use linear fit and eBayes to calculate the data. But if I only have one sample for each condition(say, 1 control, 1 experiment), can I still use…
-1
votes
1 answer

python - sqlite3.OperationalError: near "": syntax error when trying to deliver a string for comparison from a variable using fstring

I'm tryng to do something like this.. con = sqlite3.connect('tables.db') cur = con.cursor() max_tyme = '2022-06-22 17:14:01.048' cur.execute(f'''SELECT A.ID, B, A, tyme FROM A, BD WHERE A.ID = BD.ID …
Vav1r
  • 3
  • 1
-1
votes
1 answer

Date and Time compare today in Android

dateTime_form_api = "2020/02/11 10:23 AM"; dateTime_from_system = "2020/02/11 13:00 PM"; I want to compare dateTime_form_api and dateTime_from_system if dateTime_from_system after dateTime_form_api show "Next time" if dateTime_from_system…
-1
votes
1 answer

how to convert string 'Jan 23 2016 10:30:08AM' or string '23/01/2016 10:30:08' to epoch time in python?

I want to compare 2 times including dates. for example : 'Jan 23 2016 4:16:09PM' and 'Jan 24 2016 9:43:44PM' i think the easiest and best way is to convert it in epoch and compare. (Please let me know if there is any other approach better than…
flux0987
  • 69
  • 10
-1
votes
2 answers

Time comparision in java

I just get the time in HH:MM format and check if it is greater than 9:30 then count c is increased as 1.I just did for a single user input time.But i need to get multiple times from user and compare.If it is greater than 9:30 then increment the…
Harini
  • 195
  • 3
  • 14
-1
votes
1 answer

MySQL return only those values that comes between starttime and starttime+x value

I have a situation, where in column 'starttime' has unix timestamp stored. Now, I want to select only those records where: currentTime = time(); // unix timestamp currentTime >= startTime && currentTime <= (starttime + x) Where x is dynamic range…
Saurin Dashadia
  • 1,140
  • 11
  • 25
-1
votes
3 answers

Get System Time and add 30 minutes to it, after that compare it with another system time

Actually I want to disable a button for 30 minutes. The code below works well but if we kill the application and open it within 30 minutes, the button is now enabled. public static void timmer(final ImageButton btn){ new…
Taimoor Suleman
  • 1,588
  • 14
  • 29
-1
votes
2 answers

How to find date values which are more than 10 days old

I am using Java and iterating over D.B. column which in return gives me date and time string as shown below: String dateTime = resultSet.getSeries().get(0).getValues().get(0).get(0); If I iterate on this resultset I am getting dateTime values in…
Ammad
  • 4,031
  • 12
  • 39
  • 62
-1
votes
1 answer

Compare LDAP date to epoch

I'm trying to calculate LDAP accountExpires. The given value is LDAP date - nanoseconds since 01/01/1601 00:00. What is the best way to test if it is indeed after new Date()?
Nati
  • 1,034
  • 5
  • 19
  • 46