Java String to Date toDateString(Date date)

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

Description

to Date String

License

Open Source License

Declaration

public static String toDateString(Date date) 

Method Source Code

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

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

public class Main {
    public static String toDateString(Date date) {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        dateFormat.setTimeZone(TimeZone.getTimeZone("GMT+8"));
        return dateFormat.format(date);
    }/*  w  w w . ja va  2s.  c o  m*/
}

Related

  1. toDateFormat(String dateFormat, TimeZone tz, Locale locale)
  2. toDateOracle(Date d, String format, String hqlFormat)
  3. toDates(DateFormat format, String[] values)
  4. toDateString(Calendar cal)
  5. toDateString(Date date)
  6. toDateString(Date date)
  7. toDateString(Date date, String format)
  8. toDateString(Date date, String format)
  9. toDateString(Date date, String format)