get Date Is week Day - Android java.util

Android examples for java.util:Day

Description

get Date Is week Day

Demo Code


//package com.java2s;
import java.text.SimpleDateFormat;
import java.util.Calendar;

import java.util.Locale;

public class Main {

    public static String getDateIsweekDay(String year, String mouth,
            String date) {/*from  w  w w. ja va2  s  .co m*/
        int month = Integer.parseInt(mouth);
        int date1 = Integer.parseInt(date);
        int year1 = Integer.parseInt(year);
        Calendar calendar = Calendar.getInstance(Locale.US);
        calendar.set(Calendar.YEAR, year1);
        calendar.set(Calendar.MONTH, month - 1);
        calendar.set(Calendar.DATE, date1);
        String weekDay = new SimpleDateFormat("E").format(calendar
                .getTime());
        return weekDay;
    }
}

Related Tutorials