Here you can find the source of dateToFormattedString(Date toFormat)
Parameter | Description |
---|---|
toFormat | a parameter |
public static String dateToFormattedString(Date toFormat)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**//from w w w. jav a 2 s .c o m * Defines the format of each string that represent a date in our project. * The pattern is "dd.MM.yyyy HH:mm:ss" */ public static final String DATEPATTERN = "dd.MM.yyyy HH:mm:ss"; /** * Converts a Date-Object to a String with the format of the DATEPATTERN * @param toFormat * @return */ public static String dateToFormattedString(Date toFormat) { return new SimpleDateFormat(DATEPATTERN).format(toFormat); } }