Java tutorial
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static String getFormattedDateForReQuery(long timeStampInMilliSeconds) { DateFormat df = new SimpleDateFormat("yyyyy-MM-dd HH:mm:ssZ", Locale.getDefault()); Date d = new Date(timeStampInMilliSeconds); return df.format(d); } }