Android Date to String Convert dateToString(Date date)

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

Description

date To String

Declaration

public synchronized static String dateToString(Date date) 

Method Source Code

//package com.java2s;

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

public class Main {
    static SimpleDateFormat format = new SimpleDateFormat(
            "yyyy-MM-dd HH:mm:ss");

    public synchronized static String dateToString(Date date) {
        if (date == null) {
            return null;
        }//from   w w  w  .j  a va2  s . c  om
        return format.format(date);
    }
}

Related

  1. dateToString(String format, String date)
  2. dateToString(String format, Date date)
  3. dateToString(Date time)
  4. getFriendlyLocalDateTime(Date date)
  5. dateTimeToString(final Date date)
  6. datesToString(final Date start, final int duration)
  7. datesToString(final Date start, final int duration)
  8. convertDateToString(Date date)
  9. toSimpleDateFormattedString(Date date)