Java Calendar Calculate cal2Str(Calendar pCal)

Here you can find the source of cal2Str(Calendar pCal)

Description

Gets string representation of given Calendar.

License

Open Source License

Declaration

private static String cal2Str(Calendar pCal) 

Method Source Code

//package com.java2s;

import java.util.*;

public class Main {
    /**/*from w ww  . ja  v  a2  s .c  o  m*/
     * <p>Gets string representation of given Calendar.</p>
     */
    private static String cal2Str(Calendar pCal) {
        StringBuffer str = new StringBuffer();
        if (pCal != null) {
            int month = pCal.get(Calendar.MONTH) + 1;
            int date = pCal.get(Calendar.DATE);
            int year = pCal.get(Calendar.YEAR);
            str.append(month);
            str.append("/" + date);
            str.append("/" + year);
        }

        return str.toString();
    }
}

Related

  1. addQuarter(Calendar calendar, int quarterDelta)
  2. addTime(int calendarType, long time, int number)
  3. alignHours(int interval, Calendar timestamp)
  4. alignSecond(Calendar timestamp)
  5. calcAge(Calendar dateOfBirth, Calendar now)
  6. calcDifferenceAsDays(Calendar aBaseDate, Calendar aTargetDate)
  7. calcDifferenceAsYearsPrivate(Calendar aBaseDate, Calendar aTargetDate)
  8. calcTime(Date end, Date start, int calendarField)