Here you can find the source of longToDate(long millis)
Parameter | Description |
---|---|
millis | a parameter |
public static String longToDate(long millis)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.TimeZone; public class Main { /**// w w w . java2 s .c o m * Turns a long variable that represents time into a String * @param millis * @return */ public static String longToDate(long millis) { Date date = new Date(millis); SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US); dateFormat.setTimeZone(TimeZone.getDefault().getTimeZone("GMT")); return dateFormat.format(date); } }