Nama file : tanggal_File_Diubah.java
import java.io.File;
import java.text.SimpleDateFormat;
public class tanggal_File_Diubah {
public static void main(String[] args)
{
//Specify the file path and name
File file = new File("C:\\newfile.txt");
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
System.out.println("File Last Modified Date: " + sdf.format(file.lastModified()));
}
}
Output
selamat mencoba,semoga bermanfaat ...
No comments:
Post a Comment