Here you can find the source of getTodayDisplayString()
public static String getTodayDisplayString()
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; import java.util.Locale; public class Main { public static String getTodayDisplayString() { Calendar c = Calendar.getInstance(); StringBuffer sb = new StringBuffer(); sb.append(c.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.LONG, Locale.getDefault())); sb.append(", "); sb.append(get4CharDate(c.getTime())); return sb.toString(); }// ww w . j a va 2 s . c o m public static String get4CharDate(Date d) { if (d == null) return ""; StringBuffer sb = new StringBuffer(); // generate four-digit representation of date // e.g. last day of year & number of days to date, ex. 276th day Calendar c = Calendar.getInstance(); c.setTime(d); int yr = c.get(Calendar.YEAR) % 10; // get least sig digit of year int numDays = c.get(Calendar.DAY_OF_YEAR); sb.append(yr); sb.append(numDays); return sb.toString(); } }