4
Answers

c# DateTime Diff

David Smith

David Smith

14y
11.1k
1
Can someone assist me with a datetime diff situation. Im trying to figure the logic out for this.

basically im trying to compare records baseoff of a datetime, from two different tables.  The datetime is slightly off by  plus or minus 3mins.

below you will notice a 3min difference.  I want to be able to say

  //plus or minus 3minutes via datetime
   EList elTestInfoList = EList .Where(d => d.EL_OpTimeStamp  "is plus or minus 3mins"   SystemRecord.DateTime);
 
    if both datetimes are plus or minus three minutes from each other, I want to do something. so how do you set up the logic or linq  for this situation


              table  1

              datetime  ,                              field  A,    field  B,     etc............

row 1:    12/6/2007 7:00:00 AM,                       


table  2                                            
                                                          
               datetime  ,                            field  A,    field  B,     etc............

Row 1:  12/6/2007 7:03:00 AM,         field A ,    field  B ,    etc....

Answers (4)