Here you can find the source of formatDateTime(Date date)
static String formatDateTime(Date date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { static String formatDateTime(Date date) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(date); }/*from w w w .j a v a 2 s .com*/ }