Here you can find the source of convertToDateTimeString(Date d1)
Parameter | Description |
---|---|
d1 | - |
public static String convertToDateTimeString(Date d1)
//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; } }