Java Hour Format format(Date d)

Here you can find the source of format(Date d)

Description

Format the Date timestamp to a human-readable timestamp.

License

Open Source License

Parameter

Parameter Description
d The timestamp.

Return

A human-readable timestamp in the default format used in Maunium products.

Declaration

public static String format(Date d) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    private static final SimpleDateFormat def = new SimpleDateFormat("HH:mm:ss dd.MM.yyyy");

    /**//from w w  w.j  av a2 s.c  o  m
     * Format the millisecond timestamp to a human-readable timestamp.
     * 
     * @param millis The timestamp.
     * @return A human-readable timestamp in the default format used in Maunium products.
     */
    public static String format(long millis) {
        return def.format(new Date(millis));
    }

    /**
     * Format the Date timestamp to a human-readable timestamp.
     * 
     * @param d The timestamp.
     * @return A human-readable timestamp in the default format used in Maunium products.
     */
    public static String format(Date d) {
        return def.format(d);
    }
}

Related

  1. format()
  2. format()
  3. format(Calendar date)
  4. format(Date d)
  5. format(Date d)
  6. format(Date date)
  7. format(Date date)
  8. format(Date date)
  9. format(Date date)