Java Date Format dateFormat(Date date)

Here you can find the source of dateFormat(Date date)

Description

date Format

License

Apache License

Declaration

public static Date dateFormat(Date date) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static Date dateFormat(Date date) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date value = new Date();
        try {//  ww  w .  ja  v a  2s  . c  o m
            value = sdf.parse(sdf.format(date));
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return value;
    }
}

Related

  1. dateFmtToString(Date date, SimpleDateFormat fmt)
  2. dateFormat(Date d, String formatStr)
  3. dateFormat(Date date)
  4. dateFormat(Date date)
  5. dateFormat(Date date)
  6. dateFormat(Date date)
  7. dateFormat(Date date, String format)
  8. dateFormat(Date date, String format)
  9. dateFormat(Date date, String pattern)