Java Date to Time getMSDateTimeString(Date date)

Here you can find the source of getMSDateTimeString(Date date)

Description

MSTYPE yyyy-MM-dd hh:mm:ss return

License

Open Source License

Parameter

Parameter Description
date a parameter

Declaration

public static String getMSDateTimeString(Date date) 

Method Source Code


//package com.java2s;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    static SimpleDateFormat msfLong = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");

    /**//  w ww. j a va2s  .c  o m
     * MSTYPE yyyy-MM-dd hh:mm:ss return
     * @param date
     * @return
     */
    public static String getMSDateTimeString(Date date) {
        String result = null;

        if (date != null) {
            result = msfLong.format(date);
        }
        return result;
    }
}

Related

  1. extractTimeFromDate(Date date)
  2. getFriendlyTime(Date dateTime)
  3. getFriendlyTimeString(Date date)
  4. getMediumDateString(Date date, boolean includeTime)
  5. getTime(Date date)
  6. getTime(Date date)
  7. getTime(Date date)
  8. getTime(Date date)