Format 20160311 To 2016/03/11 - Android java.util

Android examples for java.util:Date Convert

Description

Format 20160311 To 2016/03/11

Demo Code

import android.annotation.SuppressLint;

public class Main{

    public static String coverToDate(String date) {
        //example 20160311
        return date.substring(0, 4) + "/" + date.substring(4, 6) + "/"
                + date.substring(6, 8);/*www .  ja  va2  s . c  o  m*/
    }

}

Related Tutorials