Android Date String to Date Convert dateToString(Date date, String format)

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

Description

date To String

Declaration

public static String dateToString(Date date, String format) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static final String VN_DATE_FORMAT = "dd/MM/yyyy";

    public static String dateToString(Date date, String format) {
        if (format == null)
            format = VN_DATE_FORMAT;/*w  ww. j a  va 2  s.  c  om*/
        SimpleDateFormat ts = new SimpleDateFormat(format);
        return ts.format(date);
    }
}

Related

  1. parseDate(String dateString)
  2. parseDateTime(String date)
  3. parseTaskWarrior(String date)
  4. getDate(String sDate, String dateFormat)
  5. convertStringToDate(String dateString, String currentFormat)
  6. parseStringToDate(String dateString, String sourceDateFormat, Locale locale)
  7. parse2Date(SimpleDateFormat s, Object d)
  8. stringToDate(String src, String format)
  9. toDateFromLongFormat(String date)