Java Date Create ToDateStr(Date dt)

Here you can find the source of ToDateStr(Date dt)

Description

To Date Str

License

Open Source License

Declaration

public static String ToDateStr(Date dt) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String ToDateStr(Date dt) {
        if (dt == null)
            return "";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return sdf.format(dt);
    }/* ww  w .  jav a 2s  . c o  m*/
}

Related

  1. toDateFromLong(Long time)
  2. toDateHeader(long value)
  3. toDateList(Collection list)
  4. toDateQueryFormat(Date value)
  5. toDateStr(Date d)
  6. toDateStr(Object o)
  7. toDateText(Date date)
  8. toDateTime(Date date)
  9. toDatetime(long value)