Java Time Format formatTime14To12String(String time)

Here you can find the source of formatTime14To12String(String time)

Description

format Time To String

License

Open Source License

Declaration

public static String formatTime14To12String(String time) 

Method Source Code

//package com.java2s;

public class Main {

    public static String formatTime14To12String(String time) {
        StringBuffer sb = new StringBuffer();
        sb.append(time.substring(0, 4) + "-" + time.substring(4, 6));
        sb.append("-" + time.substring(6, 8) + " ");
        sb.append(time.substring(8, 10) + ":" + time.substring(10, 12));
        return sb.toString();
    }/*  w  w w.j  a v  a 2  s. c  o  m*/
}

Related

  1. formatTime(String time)
  2. formatTime(String time)
  3. formatTime(String time)
  4. formatTime(String time)
  5. formatTime(String timeStr)
  6. formatTime2(long secs)
  7. formatTime2(long timeInSeconds)
  8. formatTime3(long secs)
  9. formatTimeAgo(int seconds)