Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { public static String getTimeOfDayFromString(String dateString) { java.util.Calendar c = getCalendarFromStringDate(dateString); SimpleDateFormat format = new SimpleDateFormat("HH:mm"); return format.format(c.getTime()); } public static java.util.Calendar getCalendarFromStringDate(String dateString) { java.util.Calendar calendar = java.util.Calendar.getInstance(); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); format.setTimeZone(TimeZone.getTimeZone("ETC/UTC")); try { Date date = format.parse(dateString); // System.out.println("Date ->" + date); calendar.setTime(date); return calendar; } catch (Exception e) { e.printStackTrace(); } return null; } }