This code will change the last modified date of the file to the desired date.

Java Code:
import java.io.File;
import java.util.Date;

public class FileDtModificationExp {

	public static void main(String[] args) {
		File file = new File("C:\\MyFile.txt");
		long modifiedTime = file.lastModified();
		System.out.println(new Date(modifiedTime));
		Date newModifiedDate = new Date("12/12/2006");
		long newModifiedTime = newModifiedDate.getTime();
		file.setLastModified(newModifiedTime);
	}
}