Here you can find the source of getTimestampString(long timeInMillis)
static public String getTimestampString(long timeInMillis)
//package com.java2s; //License from project: Open Source License import java.sql.Timestamp; public class Main { static public String getTimestampString(long timeInMillis) { Timestamp ts = new Timestamp(timeInMillis); String tsStr = ts.toString().substring(0, 19) + "-0" + ts.getTimezoneOffset() / 60 + "00"; /*//from ww w.ja va 2 s. c om System.out.println("toGMTString = " + ts.toGMTString()); System.out.println("toLocaleString = " + ts.toLocaleString()); System.out.println("toString = " + ts.toString()); System.out.println("timezoneOffSet = " + ts.getTimezoneOffset()); System.out.println("returned string = " + tsStr); */ return tsStr; } }