Java Date to String dateToString(Date date)

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

Description

date To String

License

LGPL

Declaration

public static String dateToString(Date date) 

Method Source Code


//package com.java2s;
//License from project: LGPL 

import java.text.DateFormat;

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

public class Main {
    private static final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";

    public static String dateToString(Date date) {
        DateFormat df = new SimpleDateFormat(DATE_FORMAT);
        if (date != null) {
            return df.format(date);
        } else {//  www .ja va 2 s  .  co m
            return null;
        }
    }
}

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)