Java Hour Format formatHourTimeHToString(Date srcDate)

Here you can find the source of formatHourTimeHToString(Date srcDate)

Description

format Hour Time H To String

License

Open Source License

Declaration

public static String formatHourTimeHToString(Date srcDate) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2005, 2006 IBM Corporation and others. 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
 * /* ww w  .j a  va 2s.  com*/
 * Contributors: IBM Corporation - initial API and implementation
 *******************************************************************************/

import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.Locale;

public class Main {

    public static String formatHourTimeHToString(Date srcDate) {
        SimpleDateFormat sdf = new SimpleDateFormat("HHmm", Locale.CHINA);
        return sdf.format(srcDate);
    }
}

Related

  1. formatHDate(java.util.Date date)
  2. formatHoraFormatadaHHMMSSStr(Date hora)
  3. formatHour(final Date date)
  4. formatHours(Locale locale, double totalhours)
  5. formatHours(long millis)
  6. formatHttpDate(Date d)
  7. formatHttpDate(Date date)
  8. formatHttpDate(Date date)
  9. formatHttpDate(Date date)