Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static String convertTimeInMillis2NiceStr(long millis) { if (millis <= 0) return "" + millis; else { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", Locale.US); return sdf.format(new Date(millis)); } } }