Hello All,
Need some help with a strange result that I am getting.
I have some from and to dates to enquire the user to input date limits to after compare with some files .Lastmodified attribute.
I am using the date format and code as follows
DateTime.DateFormat = "yyyy-MM-dd"
Dim ValFrom As Long = DateTime.DateParse(lblUPLDataDesde.Text)
Dim ValTo As Long = DateTime.DateParse(lblUPLDataAte.Text)
If (fname.ToLowerCase.EndsWith("lurl") Or fname.ToLowerCase.EndsWith("log") Or _
fname.ToLowerCase.EndsWith("svrlog") Or fname.ToLowerCase.EndsWith("json") Or _
fname.ToLowerCase.EndsWith("set")) Then
Dim FileDate As Long = File.LastModified(Starter.SharedFolder, fname)
Log($"LOG FileDate: $date{FileDate}"$)
Log($"LOG ValFrom: $date{ValFrom}"$)
Log($"LOG ValTo: $date{ValTo}"$)
If FileDate >= ValFrom And FileDate <= ValTo Then
ListFilesLOGS.Add(fname)
End If
End If
But it cannot include the files because even the dates are all 2022-10-10 in ticks they are not, they show the same in the log, but inspecting the variables ValFrom, FileDate and ValTo in ticks they show : 1665442800000, 1665501208000, 1665442800000
The values from the
DateTime.DateParse function return one value and the
File.Lastmodified return another even if the dates are the same.
Any ideas ?