type conversion warning

 

I am having a small problem.

i am trying to  abstract 2 dates, and get how many days the are, with the following code

 string lastdate2="";

  handle3 = FileOpen("Time.txt",FILE_TXT|FILE_READ);
 lastdate2=FileReadString(handle3);
FileClose( handle3 );  

         
datetime last= StrToTime(lastdate2);
datetime now   = TimeCurrent();

int      seconds = now - last;
 int        minutes = seconds/60;
 int        hours=minutes/60;
double DaysPassed =hours/24;

but i get a warning

possible loss of data due to type conversion.

Any ideas what i do wrong?


 
Ioannis Christopoulos: Any ideas what i do wrong?
  1. Failed to state on what line and column the error exists;

  2. The difference between two datetimes could be larger than an int can hold. The year 3000 is 32,530,207,644 and max int is 2,147,483,647

  3. Cast it
    int      seconds = int(now - last);