Java Hour Format formatSDate(java.util.Date date)

Here you can find the source of formatSDate(java.util.Date date)

Description

Format S date.

License

Apache License

Parameter

Parameter Description
date the date

Return

the string

Declaration

public static String formatSDate(java.util.Date date) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;

public class Main {
    /**// w ww .  ja  va2s  . c  o  m
     * Format S date.
     *
     * @param date the date
     * @return the string
     */
    public static String formatSDate(java.util.Date date) {
        if (date == null)
            return "";
        else {
            SimpleDateFormat bartDateFormat = new SimpleDateFormat("yyyy-M-d HH:mm:ss");
            return bartDateFormat.format(date);
        }
    }
}

Related

  1. formatRFC822(Date date)
  2. formatRFC822(Date date, Locale locale)
  3. formatRFC822(Date date, String timezone)
  4. formatRfc822Date(Date date)
  5. formatRuntime(long runtime)
  6. formatShortDate(java.util.Date date)
  7. formatShortTime()
  8. formatSimpleTimeAndDateString(Date date)
  9. formatSingleFractionHours(Double updatedHours)