File file= new File("C:\\Documents and Settings\\Administrator\\Desktop\\ajay\\abc.csv"); Timestamp ts=new Timestamp(new Date().getTime()); String str= ts.toString(); String st="C:\\Documents and Settings\\Administrator\\Desktop\\ajay\\abc\\"+str+".csv"; System.out.println(new Date().getTime()); boolean b=file.renameTo(new File(st)); System.out.println(b); In this code snippet I try to rename the file but I'm unable to find the error in it.
java.sql.Timestamphere? What's the functional requirement? You might have misunderstood its purpose.