Java Hour Format formatDateTimeFull(Date dateTime)

Here you can find the source of formatDateTimeFull(Date dateTime)

Description

format Date Time Full

License

Open Source License

Return

Localized date time value in format yyyy-MM-dd HH:mm:ss

Declaration

public static String formatDateTimeFull(Date dateTime) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/

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

public class Main {
    private static SimpleDateFormat fullDateTimeDF = // getDateTimeFullFormat
            new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
    private static String NOT_DEFINED_DATE = "-";

    /**//from w w  w. j a v a  2s.  c o m
     * @return Localized date time value in format yyyy-MM-dd HH:mm:ss
     */
    public static String formatDateTimeFull(Date dateTime) {
        if (dateTime == null) {
            return NOT_DEFINED_DATE;
        }
        return fullDateTimeDF.format(dateTime);
    }
}

Related

  1. formatDateTime(String dateTime)
  2. formatDateTime(String strDateTime, String strFormat)
  3. formatDateTime12(String dateStr)
  4. formatDateTime24()
  5. formatDateTimeForSolr(Date d)
  6. formatDateTimeStringForEquivalentCommand(final Date date)
  7. formatDateToEndDateTime(String strDate)
  8. formatDateToHMSString(java.util.Date date)
  9. formatDateToHours(Date time)