Java Hour Format formatTime(final Date date)

Here you can find the source of formatTime(final Date date)

Description

format Time

License

Open Source License

Declaration

public static String formatTime(final Date date) 

Method Source Code

//package com.java2s;
/*//from   w  ww.java2 s.c  om
 * [y] hybris Platform
 * 
 * Copyright (c) 2000-2015 hybris AG
 * All rights reserved.
 * 
 * This software is the confidential and proprietary information of hybris
 * ("Confidential Information"). You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the
 * license agreement you entered into with hybris.
 */

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String formatTime(final Date date) {
        final SimpleDateFormat df = new SimpleDateFormat(
                "yyyy-MM-dd HH:mm:ss");
        return df.format(date);
    }
}

Related

  1. formatTime(Date date)
  2. formatTime(Date time)
  3. formatTime(Date time)
  4. formatTime(double s)
  5. formatTime(final Calendar cal)
  6. formatTime(final long time)
  7. formatTime(int msec, String format)
  8. formatTime(java.util.Date date)
  9. formatTime(long aTime)