Java Date to String datetoStr3(Date date)

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

Description

dateto Str

License

Apache License

Declaration

public static String datetoStr3(Date date) 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String dateToStr3(Date date) {
        if (date == null) {
            return "";
        }//from w w  w  .j a va  2  s  . c  o  m
        SimpleDateFormat sdate = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        return sdate.format(date);
    }

    public static String datetoStr3(Date date) {
        if (date == null) {
            return "";
        }
        SimpleDateFormat sdate = new SimpleDateFormat("yyyy/MM/dd");
        return sdate.format(date);
    }
}

Related

  1. dateToStr(Date date, String format)
  2. dateToStr(Date date, String formatstr)
  3. dateToStr(Date date, String formatType)
  4. dateToStr(Date source)
  5. datetoStr2(Date date)
  6. dateToStrIBInput(Date date)
  7. dateToString(Date d)
  8. dateToString(Date d)
  9. dateToString(Date d)