Java Integer to intToTime(int value)

Here you can find the source of intToTime(int value)

Description

int To Time

License

Open Source License

Declaration

public static String intToTime(int value) 

Method Source Code

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

public class Main {
    public static String intToTime(int value) {
        int hour = value;
        String ampm = "am";
        if (hour > 12) {
            hour -= 12;//ww  w  .jav  a 2s.co m
            if (hour != 12)
                ampm = "pm";
        }
        if (hour == 0)
            hour = 12;
        return String.format("%d:00%s", hour, ampm);
    }
}

Related

  1. intToSlider(final int min, final int max, final int value)
  2. intToSortableBytes(int value, byte[] result, int offset)
  3. intToStringBuffer(final int param, final int len)
  4. intToStringWithZeroFill(int intValue, int width)
  5. intToTime(int time)
  6. intToTriplePlace(int i)
  7. intToTwoByte(int value, byte[] destination, int offset)
  8. intToTwoBytes(int value)
  9. intToTwoDigitString(int integer)