Java String to Date toDateString(long lval)

Here you can find the source of toDateString(long lval)

Description

Returns the string for the given long as a date.

License

Open Source License

Parameter

Parameter Description
lval The long .

Declaration

public static String toDateString(long lval) 

Method Source Code

//package com.java2s;

import java.text.DateFormat;

import java.util.Date;

public class Main {
    private static DateFormat dateFormat;

    /**/*from  ww w.  ja  va2s. c o  m*/
     * Returns the string for the given {@code long} as a date.  This is used by
     * {@link #displayString(Object,boolean)} when it guesses that a {@code
     * long} is a date.
     *
     * @param lval The {@code long}.
     *
     * @see #toString(Date)
     */
    public static String toDateString(long lval) {
        return dateFormat.format(new Date(lval));
    }
}

Related

  1. toDateString(final Date date)
  2. toDateString(java.util.Date date)
  3. toDateString(java.util.Date date)
  4. toDateString(java.util.Date date, String format)
  5. toDateString(java.util.Date date, String spe)
  6. toDateString(long ms)
  7. toDateString(String fmt, Date date)
  8. toDateStyleBoth(String dateStr)
  9. toDatetime(String sDate)