Here you can find the source of intToTime(int value)
public static String intToTime(int value)
//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); } }