I am trying to get information on when was the last date a file was modified in java. I have the date in long format. I dont know why the long object is showing the year to be 1970.Below is my code
File mypath=new File(my_global_folder+"/"+mydata.getItemAtPosition(position));
long time=mypath.lastModified();
//When i try to convert long to Date the year part reads 1970
Date mydate= new Date(time);
Can anyone help me modify the code to give the right lat modified date
KINYUA_1 0 Newbie Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
KINYUA_1 commented: Am debugging on android, when i toast the date in string format, it shows 1970 as the year +0
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
KINYUA_1 commented: Thankslet me try that code +0
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.