Android Date Format toDateString(Date value)

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

Description

to Date String

License

Apache License

Declaration

public static String toDateString(Date value) 

Method Source Code

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

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

public class Main {
    public static String toDateString(Date value) {
        if (value != null) {
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
            dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));

            return dateFormat.format(value);
        } else {/*from w  ww . j  a  v  a 2s  .c  om*/
            return "";
        }
    }
}

Related

  1. getFormatTomorrow(String format)
  2. getFormatYestoday(String format)
  3. getUniversalDateStamp(Date date)
  4. getUtcTimeStringFromDate(Date date)
  5. timestampToISO8601(Date aDate)
  6. toDateTimeString(Date value)
  7. toRelativeDateString(Date value)
  8. toString(Date date, String format)
  9. toString(Date value, String format)