Java Calendar Format calToString(Calendar cal)

Here you can find the source of calToString(Calendar cal)

Description

cal To String

License

Open Source License

Declaration

static String calToString(Calendar cal) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Main {
    static String calToString(Calendar cal) {
        // java.text.SimpleDateFormat f = new java.text.SimpleDateFormat("MM/dd/yyyy");
        DateFormat f = SimpleDateFormat.getDateInstance(DateFormat.SHORT);
        return f.format(cal.getTime());
    }//from  www. j a  v  a  2s  .c  o m
}

Related

  1. format(Calendar cal)
  2. format(Calendar cal)
  3. format(Calendar cal, String format)
  4. format(Calendar cal, String pattern)