Here you can find the source of toString(Calendar modifiedTime, String pattern)
public static String toString(Calendar modifiedTime, String pattern)
//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()); } }