Get current day as String - Android java.util

Android examples for java.util:Day

Description

Get current day as String

Demo Code


//package com.java2s;

import java.util.Calendar;

public class Main {
    /**//from w  w  w  .ja va2  s.  c om
     * Get current day
     * @return day in String format
     */
    public static String currentDay() {
        Calendar cal = Calendar.getInstance();
        int dayOfMonth = cal.get(Calendar.DAY_OF_MONTH);
        return String.valueOf(dayOfMonth);
    }
}

Related Tutorials