Here you can find the source of getSysDateTimeForFileName()
Parameter | Description |
---|---|
Exception | if error |
public static String getSysDateTimeForFileName() throws Exception
//package com.java2s; /*//from w ww. j a va 2 s .c om * Copyright (C) 2010 Viettel Telecom. All rights reserved. * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { /** * * @return String for match with file name * @throws Exception if error */ public static String getSysDateTimeForFileName() throws Exception { Calendar calendar = Calendar.getInstance(); SimpleDateFormat dateFormat = new SimpleDateFormat("dd_MM_yyyy_HH_mm"); try { return dateFormat.format(calendar.getTime()); } catch (Exception e) { throw e; } } }