Here you can find the source of getFormattedTimestamp(File file)
public static String getFormattedTimestamp(File file)
//package com.java2s; /******************************************************************************* * Copyright (c) 2014 Salesforce.com, inc.. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * /* ww w . ja v a 2s.com*/ * Contributors: * Salesforce.com, inc. - initial API and implementation ******************************************************************************/ import java.io.File; import java.text.DateFormat; import java.util.Date; import java.util.Locale; public class Main { public static String getFormattedTimestamp(File file) { return file != null && file.exists() ? getLocaleFormattedDateTime(file.lastModified()) : null; } public static String getLocaleFormattedDateTime(long datetime) { return DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM, Locale.getDefault()) .format(new Date(datetime)); } }