Android Date to String Convert getStrFromDate(Date date)

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

Description

get Str From Date

Declaration

public static String getStrFromDate(Date date) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String today;

    public static String getStrFromDate(Date date) {
        Date curDate = date;//from   w  w w.j a v  a 2 s . co m
        SimpleDateFormat sdf;
        sdf = new SimpleDateFormat("yyyy-MM-dd");

        today = sdf.format(curDate);
        // today = sdf.format(1000);
        return today;

    }
}

Related

  1. getStringFromDate(Date date)
  2. javaDateToIso8601(Date date)
  3. javaDateToTimeSpan(final Date date)
  4. toGMTDate(Date localDate)
  5. toString(Date date)
  6. dateToString(Date date)
  7. dateToString(String format, String date)
  8. dateToString(String format, Date date)
  9. dateToString(Date time)