Here you can find the source of format(Date date, String format, Locale locale)
Parameter | Description |
---|---|
date | the date |
format | the format |
locale | the locale |
public static String format(Date date, String format, Locale locale)
//package com.java2s; /*/* w ww .j ava 2 s. c om*/ * Copyright(C) 2016 thuebannhadat.com.vn. All rights reserved. * * This software is the confidential and proprietary information of * thuebannhadat.com.vn. You shall not disclose such Confidential Information * and shall use it only in accordance with the terms of the license * agreement you entered into with thuebannhadat.com.vn. */ import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { /** * Format date to String. * * @param date * the date * @param format * the format * @param locale * the locale * @return the string */ public static String format(Date date, String format, Locale locale) { if (date != null && format != null && locale != null) { return new SimpleDateFormat(format, Locale.ENGLISH).format(date); } return null; } }