Java Timestamp Format format(final long unixTimeStamp)

Here you can find the source of format(final long unixTimeStamp)

Description

format

License

Apache License

Declaration

public static String format(final long unixTimeStamp) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;

import java.util.Date;
import java.util.TimeZone;

public class Main {
    public static String format(final long unixTimeStamp) {
        final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
        sdf.setTimeZone(TimeZone.getTimeZone("UTC"));

        return sdf.format(new Date(unixTimeStamp * 1000L));
    }//from   www  .  j ava 2  s.c  o m
}

Related

  1. format(Date time, String pattern)
  2. format(Date timestamp)
  3. format(Date timestamp, String format)
  4. Format(DateFormat format, Timestamp time)
  5. format(final Date date)
  6. format(long timestamp)
  7. format(long timeStamp)
  8. format(Timestamp time)
  9. format2AdwordsTimestamp(Date date)