Android Long to Date Convert toString(Long datetime)

Here you can find the source of toString(Long datetime)

Description

to String

Parameter

Parameter Description
datetime the actual date and time in milliseconds

Return

The String representation in format yyyyMMddHHmmss

Declaration

public static String toString(Long datetime) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    /**/*from   ww  w.j  av a 2  s . c  o  m*/
     * @param datetime the actual date and time in milliseconds
     * @return The String representation in format yyyyMMddHHmmss
     */
    public static String toString(Long datetime) {
        String result = new SimpleDateFormat("yyyyMMddHHmmss")
                .format(new Date(datetime));
        return result;
    }
}

Related

  1. toDateString(long seconds)
  2. toFullDate(long timestamp)
  3. toIso8601(long date, boolean utc)
  4. toJulianDay(long epochMillis)
  5. toJulianDayNumber(long epochMillis)
  6. toTimeString(long milliseconds)
  7. stringForTime(long timeMs)
  8. getTimeString(long millis)
  9. parseTime(long time, String pattern)