title: Date in to UTC format Java
body: <p>I have a string like this <code>2013-10-22T01:37:56</code>. I Need to change this string into UTC Date format like this <code>MM/dd/yyyy KK:mm:ss a</code>. I have tried some code but it is not returning the UTC datetime.</p>
  
  <p>My code is</p>
  
  <pre><code>        String[] time = itsAlarmDttm.split("T");
          String aFormatDate = time[0]+ " "+time[1];
          String aRevisedDate = null;
          try {
              final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
              final Date dateObj = sdf.parse(aFormatDate);
              aRevisedDate = new SimpleDateFormat("MM/dd/yyyy KK:mm:ss a").format(dateObj);
              System.out.println(aRevisedDate);
          } catch (ParseException e) {
              itsLogger.error("Error occured in Parsing the Data Time Object:  " +e.getMessage());
          } catch (Exception e) {
              itsLogger.error("Error occured in Data Time Objecct:  " +e.getMessage());
          }
  </code></pre>
  
  <p>I am getting the output is <code>MM/dd/yyyy KK:mm:ss a</code> format. But Not UTC time format.
  How to solve this issue?</p>