Here you can find the source of getLocalDateTimeForFileName(Date date)
Parameter | Description |
---|---|
date | a parameter |
public static String getLocalDateTimeForFileName(Date date)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { /**//from www . j a v a 2s .c om * Return current date time as a concatenated string, to be used as filename. * @param date * @return */ public static String getLocalDateTimeForFileName(Date date) { final SimpleDateFormat sdf = new SimpleDateFormat("MMddyyyy_HHmmss"); sdf.setTimeZone(TimeZone.getDefault()); return sdf.format(date); } }