S Smee Well-Known Member Licensed User Longtime User Sep 12, 2011 #1 I am trying to comparte two dates, One is of a file on an internet server and for this i am using B4X: FileTimeStamp=DateTime.Date(Files(i).Timestamp) and one in the internal directory B4X: OldStamp=DateTime.Date(File.LastModified(File.DirInternal & "/cats" & DlFolderName & "/", Files(i).Name) I am getting an error when i make the comparison B4X: Log(FileTimeStamp) Log(OldStamp) If OldStamp < FileTimeStamp Then end if Even though the dates log correctly
I am trying to comparte two dates, One is of a file on an internet server and for this i am using B4X: FileTimeStamp=DateTime.Date(Files(i).Timestamp) and one in the internal directory B4X: OldStamp=DateTime.Date(File.LastModified(File.DirInternal & "/cats" & DlFolderName & "/", Files(i).Name) I am getting an error when i make the comparison B4X: Log(FileTimeStamp) Log(OldStamp) If OldStamp < FileTimeStamp Then end if Even though the dates log correctly
Erel B4X founder Staff member Licensed User Longtime User Sep 12, 2011 #2 DateTime.Date returns a string. You cannot compare two strings like this. Instead you should keep the "ticks" values and compare these values. Ticks values should be stored in Long variables. Upvote 0
DateTime.Date returns a string. You cannot compare two strings like this. Instead you should keep the "ticks" values and compare these values. Ticks values should be stored in Long variables.