Java Calendar to String calendarToString(Calendar c)

Here you can find the source of calendarToString(Calendar c)

Description

calendar To String

License

Apache License

Declaration

public static String calendarToString(Calendar c) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

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

public class Main {
    public static String calendarToString(Calendar c, String pattern) {
        if (c != null) {
            SimpleDateFormat format = new SimpleDateFormat(pattern);
            return format.format(c.getTime());
        }/*  www.jav  a  2s .co  m*/
        return null;
    }

    public static String calendarToString(Calendar c) {
        return calendarToString(c, "yyyyMMddHHmmss");
    }
}

Related

  1. calendarOutput(Calendar date)
  2. calendarParaString(Calendar cal)
  3. calendarToIso(Calendar c)
  4. calendarToSiteDataString(final Calendar cal)
  5. calendarToStorageRoomTimeString(Calendar cal)
  6. calendarToString(Calendar c, String format)
  7. calendarToString(Calendar cal)
  8. calendarToString(Calendar cal)
  9. calendarToString(Calendar cal, String format)