Java tutorial
//package com.java2s; import android.widget.TextView; public class Main { public static String getDateNoWeek(String temp) { if (temp != null && temp.length() > 10) { return temp.substring(0, 10); } return temp; } public static String getDateNoWeek(TextView tv) { if (tv != null) { final String temp = tv.getText().toString(); return getDateNoWeek(temp); } return ""; } }