Java Date from String convertToDateTimeString(Date d1)

Here you can find the source of convertToDateTimeString(Date d1)

Description

convert To Date Time String

License

Open Source License

Parameter

Parameter Description
d1 -

Return

-

Declaration

public static String convertToDateTimeString(Date d1) 

Method Source Code


//package com.java2s;
import java.text.DateFormat;

import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.TimeZone;

public class Main {
    /**//www  .j ava  2s  . c o  m
     * @param d1 -
     * @return -
     */
    public static String convertToDateTimeString(Date d1) {
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
        df.setTimeZone(TimeZone.getTimeZone("GMT"));

        String dString = df.format(d1);

        return dString;
    }
}

Related

  1. convertToDate(String strDate, String format)
  2. convertToDate(String strDate, String format)
  3. convertToDate(String val)
  4. convertToDate(String value)
  5. convertToDateTimeNoSec(String date)
  6. convertToDateWithTimeString(Date date)
  7. getDateFromPattern(String pattern)
  8. getDateFromReccurenceInterval(int reqDOW, int reqDOM, int time)
  9. getDateFromStartTime(String startTime)