Here you can find the source of getTime(String file)
public static String getTime(String file)
//package com.java2s; //License from project: Apache License import java.io.File; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getTime(String file) { return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(new File(file).lastModified())); }// w w w. ja v a2 s . c om }