Here you can find the source of parseLastModifDate(final File file)
Parameter | Description |
---|---|
file | input file. |
public static String parseLastModifDate(final File file)
//package com.java2s; /*//w w w . ja va2s.c o m * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2013, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. */ import java.io.File; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /** * Parse date with pattern yyyyMMddHHmm. Pattern is used in get file command * response XML. * @param file input file. * @return parsed file modification date. */ public static String parseLastModifDate(final File file) { Date date = new Date(file.lastModified()); DateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmm"); return dateFormat.format(date); } }