Java Date to String dateToString(Date date)

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

Description

date To String

License

Open Source License

Declaration

public static String dateToString(Date date) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;
import java.util.Formatter;

public class Main {
    private static final SimpleDateFormat dateformat = new SimpleDateFormat(
            "yyyy-MM-dd");

    public static String dateToString(Date date) {
        return dateformat.format(date);
    }/*  w  ww  . ja va  2  s.c  o m*/

    public static String format(String format, Object... args) {
        return format(null, format, args);
    }

    public static String format(StringBuilder builder, String format,
            Object... args) {
        if (builder == null) {
            builder = new StringBuilder();
        }
        new Formatter(builder).format(format, args);
        return builder.toString();
    }
}

Related

  1. dateToString(Date date)
  2. dateToString(Date date)
  3. DateToString(Date date)
  4. dateToString(Date date)
  5. DateToString(Date date)
  6. dateToString(Date date)
  7. dateToString(Date date)
  8. dateToString(Date date)
  9. dateToString(Date date)