Java Date to String convert(Date date)

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

Description

convert

License

Apache License

Declaration

public static String convert(Date date) 

Method Source Code


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

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

public class Main {
    public static String convert(Date date) {
        //2005-05-10T17:33:30+08:00
        //yyyy-MM-dd'T'HH:mm:ss.SSSZ
        final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");

        return dateFormat.format(date);
    }/* ww w  .  j a va 2 s  .co m*/
}

Related

  1. convert(Date date, String style)
  2. convertDate(Date d)
  3. convertDate(Date date)
  4. convertDate(Date date)