How to compare two datetime values?
For example as per below condition, I have FDatetimes
value is string coming (i.e 2021-06-21 17:00:30Z) from database and SDatetimes
value should be Datetime.UtcNow
. So my requirement is both left and right side always compare with datetime instead of string.
Also I have tried to use Convert.ToDateTime(FDatetimes)
. But there is one issue here. Whenever I have used the above function, That time the time is getting changed to 2021-06-21 10:00:30Z. My main aim is to compare both field value as DateTime instead of String. Please help in VB.Net
If FDatetimes < SDatetimes Then
'My logic
End If