Java SQL Date Format formatDateToCustfmt(java.util.Date date, String dateFmt)

Here you can find the source of formatDateToCustfmt(java.util.Date date, String dateFmt)

Description

format Date To Custfmt

License

Open Source License

Declaration

public static Date formatDateToCustfmt(java.util.Date date, String dateFmt) 

Method Source Code

//package com.java2s;

import java.util.Date;

public class Main {

    public static Date formatDateToCustfmt(java.util.Date date, String dateFmt) {
        if (date == null) {
            return null;
        }/*from w w  w .  ja  v  a2 s.  c  o m*/
        java.text.SimpleDateFormat dateFormat = new java.text.SimpleDateFormat(dateFmt);
        return java.sql.Date.valueOf(dateFormat.format(date));

    }
}

Related

  1. formatBytableCols(Object[] obj, String[] tableCols)
  2. formatDate(java.util.Date uDate)
  3. formatDate(Object obj)
  4. formatDate(String date)
  5. formatDateTd(Object obj)
  6. formatDurationMillisToString(long millis)
  7. formatFloat(int floatValue)
  8. formatLogParam(Array obj)
  9. formatNumberWithZeroPrefix(int numOfZero, Integer value)