How to convert week number to week name(short form) in android/java

 * @param weekDayNumber Week Number starts with 1. For <b>Sunday</b> it is <b>1</b> and for <b>Saturday</b> it is <b>7</b>.
 * @return
 public static String getWeekDayShortName(int weekDayNumber)
 String weekName = "";
 if(weekDayNumber>0 && weekDayNumber<8)
 try {
 Calendar calendar = Calendar.getInstance();
 calendar.set(Calendar.DAY_OF_WEEK, weekDayNumber);

 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EE");
 weekName = simpleDateFormat.format(calendar.getTime());
 } catch (Exception e) {
 return weekName;

Tags: , , , ,

About krishjlk

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: