get Day Of Week from Date - Android java.util

Android examples for java.util:Week

Description

get Day Of Week from Date

Demo Code


//package com.java2s;

import java.util.Calendar;
import java.util.Date;

public class Main {
    public static int getDayOfWeek(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);/*from  w w w . j av  a 2  s. com*/
        int dow = calendar.get(Calendar.DAY_OF_WEEK);
        return dow;
    }
}

Related Tutorials