Here you can find the source of formatDashedDateDDMMYYYY(Date date)
Parameter | Description |
---|---|
date | a date to format. |
public static String formatDashedDateDDMMYYYY(Date date)
//package com.java2s; /*//from w ww . j a v a 2 s . c om * Copyright (c) 2015-2016 QuartzDesk.com. * Licensed under the MIT license (https://opensource.org/licenses/MIT). */ import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { private static final String DATE_FORMAT_DASHED_DD_MM_YYYY = "dd-MM-yyyy"; /** * Formats the specified date as dd-MM-yyyy. * * @param date a date to format. * @return the formatted date. */ public static String formatDashedDateDDMMYYYY(Date date) { SimpleDateFormat f = new SimpleDateFormat(DATE_FORMAT_DASHED_DD_MM_YYYY); f.setTimeZone(TimeZone.getDefault()); return f.format(date); } }