import java.io.File;
import java.util.Date;
import java.text.SimpleDateFormat;
public class JavaApplication1
{
public static void main(String[] args)
{
try
{
File file = new File("d:\\data.txt");
SimpleDateFormat simpledateformat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
System.out.println(simpledateformat.format(file.lastModified()));
String newdate = "06/18/2013 12:10:31";
Date date = simpledateformat.parse(newdate);
file.setLastModified(date.getTime());
System.out.println(simpledateformat.format(file.lastModified()));
}
catch (Exception e)
{
System.out.println(e.toString());
}
}
}
/*
run:
12/31/1999 03:42:17
06/18/2013 12:10:31
*/