Android Date to String Convert dateToString(Date time)

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

Description

date To String, "yyyy-MM-dd HH:mm:ss"

Declaration

public static String dateToString(Date time) 

Method Source Code

//package com.java2s;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static String dateToString(Date time) {
        SimpleDateFormat formatter;
        formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String ctime = formatter.format(time);

        return ctime;
    }// ww  w. j  av a2s .co  m
}

Related

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