Java Calendar Format formatCalendar(Calendar calendar)

Here you can find the source of formatCalendar(Calendar calendar)

Description

format Calendar

License

Apache License

Declaration

public static String formatCalendar(Calendar calendar) 

Method Source Code

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

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

import java.util.TimeZone;

public class Main {
    public static String formatCalendar(Calendar calendar) {
        final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS z";
        SimpleDateFormat dateFormat = new SimpleDateFormat(
                DEFAULT_DATE_FORMAT);//w ww  . ja v a2s . c  om
        dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
        return dateFormat.format(calendar.getTime());
    }
}

Related

  1. format(Calendar self, String pattern)
  2. format(final Calendar cal)
  3. formatarData(Calendar data)
  4. formatCalendar(Calendar calendar)
  5. formatCalendar(Calendar calendar)
  6. formatCalendar(Calendar calendar)
  7. formatCalendar(Calendar objCal, String strFormat)
  8. formatCalendarTS(Calendar value)
  9. formatCalendarXsdZulu(Calendar c, int millisDigits)