Here you can find the source of formatDate(java.util.Date uDate)
Parameter | Description |
---|---|
uDate | java.util.Date |
public static String formatDate(java.util.Date uDate)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; public class Main { /**/*from ww w . j a va 2s. c o m*/ * <h1>formatDate</h1> Dinh dang ngay kieu java.util.Date thanh String theo * mau "dd/MM/yyyy" * * @param uDate * java.util.Date * @return Chuoi ngay theo dinh dang "dd/MM/yyyy" hoac null */ public static String formatDate(java.util.Date uDate) { if (uDate == null) { return null; } else { SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); return dateFormat.format(uDate); } } /** * <h1>formatDate</h1> Dinh dang ngay kieu java.sql.Date thanh String theo * mau "dd/MM/yyyy" * * @param sDate * java.sql.Date * @return Chuoi ngay theo dinh dang "dd/MM/yyyy" hoac null */ public static String formatDate(java.sql.Date sDate) { if (sDate == null) { return null; } else { SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); return dateFormat.format(sDate); } } }