get Today's Date as Calendar - Android java.util

Android examples for java.util:Today

Description

get Today's Date as Calendar

Demo Code


//package com.java2s;
import android.content.Context;

import java.util.Calendar;

public class Main {
    /**// ww w .ja v  a 2 s . c  o  m
     *
     * @param context
     * @param firstDayOfWeek
     * @return
     */
    public static Calendar getTodayCalendar(Context context,
            int firstDayOfWeek) {
        Calendar currentCalendar = Calendar.getInstance(context
                .getResources().getConfiguration().locale);
        currentCalendar.setFirstDayOfWeek(firstDayOfWeek);

        return currentCalendar;
    }
}

Related Tutorials