public static String toISO8601 ( Date date ) { DateFormat dateFormat = new SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ssXXX" , Locale . US ) ; dateFormat . setTimeZone ( TimeZone . getTimeZone ( "UTC" ) ) ; return dateFormat . format ( date ) ; }
Formats a Date as an ISO - 8601 string representation .