Java Time to String toString(Calendar modifiedTime, String pattern)

Here you can find the source of toString(Calendar modifiedTime, String pattern)

Description

to String

License

Open Source License

Declaration

public static String toString(Calendar modifiedTime, String pattern) 

Method Source Code

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

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

import java.util.TimeZone;

public class Main {
    public static TimeZone IST = TimeZone.getTimeZone("IST");

    public static String toString(Calendar modifiedTime, String pattern) {
        SimpleDateFormat formatter = new SimpleDateFormat(pattern);
        formatter.setTimeZone(IST);/* ww w.ja va2 s.  c om*/
        return formatter.format(modifiedTime.getTime());
    }
}

Related

  1. timeToString(java.util.Date date)
  2. timeToString(long time)
  3. timeToString(long time)
  4. timeToString(long time)
  5. timeToString(long time)
  6. toString(Date d, boolean includeTime)
  7. toString(Date time)
  8. toString(long time)