Java tutorial
//package com.java2s; import android.content.Context; import android.text.format.DateFormat; import java.util.Date; import java.util.TimeZone; public class Main { /** @param time input in seconds and already in proper timezone @return time in GMT0 timezone */ public static String getTimeStamp(Context context, long time) { java.text.DateFormat df = DateFormat.getTimeFormat(context); df.setTimeZone(TimeZone.getTimeZone("GMT")); return df.format(new Date(time * 1000L)); } }