Get the day of the month from a calendar to a string. - Android java.util

Android examples for java.util:Month

Description

Get the day of the month from a calendar to a string.

Demo Code


//package com.java2s;

import java.util.Calendar;
import java.util.GregorianCalendar;

public class Main {
    /**/*w w  w  .j  a v  a 2 s. c o  m*/
     * Get the day of the month from a calendar to a string.
     * @param calendar The Calendar to convert.
     * @return The formatted day of the month.
     */
    public static String convertToDayOfMonthString(
            GregorianCalendar calendar) {
        return Integer.toString(calendar.get(Calendar.DAY_OF_MONTH));
    }
}

Related Tutorials