Here you can find the source of unixtimeToString(long unixSeconds)
Parameter | Description |
---|---|
unixSeconds | Unix time in seconds |
public static String unixtimeToString(long unixSeconds)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**/* w ww . j a v a 2 s . c o m*/ * Returns human-readable time string. * @param unixSeconds Unix time in seconds * @return date and time as string */ public static String unixtimeToString(long unixSeconds) { long unixMilliseconds = unixSeconds * 1000L; Date date = new java.util.Date(unixMilliseconds); SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"); sdf.setTimeZone(java.util.TimeZone.getTimeZone("Europe/Berlin")); return sdf.format(date); } }