Java Hour Format formatAsHour(long l)

Here you can find the source of formatAsHour(long l)

Description

format As Hour

License

Open Source License

Declaration

public static String formatAsHour(long l) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.text.DateFormat;

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

public class Main {
    private static final DateFormat df2 = new SimpleDateFormat("MM/dd-HH:mm");
    private static final DateFormat dfHour = new SimpleDateFormat("HH:mm");

    public static String formatAsHour(long l) {
        return dfHour.format(new Date(l * 60 * 1000));
    }// w  w  w  .j  a va 2  s.com

    public static String format(long l) {
        return df2.format(new Date(l * 60 * 1000));
    }
}

Related

  1. formatAbsoluteTime(long time)
  2. formatAddTime(Date addTime)
  3. formatAllDate(Date date)
  4. formatAsCassandraDateTime(Date date)
  5. formatAsDateAndTime(Date date)
  6. formatAsRoundTripDate(Date date)
  7. formatAsXsdDateTime(Date date)
  8. formatCalendarForXpath(Calendar date)
  9. formatCalTime(Date time)