Here you can find the source of getTimeInProvenanceFormat(Date date)
public static String getTimeInProvenanceFormat(Date date)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { public static String getTimeInProvenanceFormat() { SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssXXX"); sdf.setTimeZone(TimeZone.getDefault()); return sdf.format(new Date()); }/*from w ww .jav a2s. co m*/ public static String getTimeInProvenanceFormat(Date date) { SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssXXX"); sdf.setTimeZone(TimeZone.getDefault()); return sdf.format(date); } }