i am trying to covert second to days hours minutes and seconds i
am trying to calculate the time a page takes to download so number of
bits / connection speed bits per second
this is the code i have written to do it but it needs me to type cast
any help appreciated or if there is a better way to do this please
help .
public void SecondsConverter()
{
double days;
long Ldays;
double hours;
long Lhours;
double minute;
long Lminute;
long Lsecond;
Double calcspeed;
calcspeed.=Speed;
days=calcspeed/86400;
if(days<0)
Ldays=days.longValue();
else
Ldays=00;
calcspeed=calcspeed-(Ldays*86400);
hours=Speed/3600;
if(hours<0)
Lhours=hours.longValue();
else
Lhours=00;
calcspeed=calcspeed-(Lhours*3600);
minute=Speed/60;
if(minute<0)
Lminute=minute.longValue();
else
Lminute=00;
calcspeed=calcspeed-(Lminute*60);
Lsecond=calcspeed.longValue();
String ConnSpeed= Long.toString(Ldays)
+":"+Long.toString(Lhours)+":"+Long.toString(Lminute)
+":"+Long.toString(Lsecond)+"(Days:Hours:Minutes:Secs)";
}