Android - getTimeZone returning date

0

My command returns in System only the hours, but when it is posted in the database it displays the time and date.

I would like to return only the hours, what is wrong?

 Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT-3:00"));
    Date currentLocalTime = cal.getTime();
    DateFormat date = new SimpleDateFormat("HH:mm");
    // you can get seconds by adding  "...:ss" to it
    date.setTimeZone(TimeZone.getTimeZone("GMT-3:00"));
  final  String localTime = date.format(currentLocalTime);

            Hours = localTime;


  System.out.println(localTime);

Output:

  

I / System.out: 09:54

     

Post to the bank ..

  postDataParams.put("hora_anun", Hours);
    
asked by anonymous 30.06.2017 / 15:08

0 answers