Here you can find the source of toTime(int value)
public static java.sql.Time toTime(int value)
//package com.java2s; /**//from ww w. ja v a2s. co m * Project: ${puma-server.aid} * * File Created at 2012-6-11 $Id$ * * Copyright 2010 dianping.com. All rights reserved. * * This software is the confidential and proprietary information of Dianping * Company. ("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 dianping.com. */ import java.util.Calendar; public class Main { public static java.sql.Time toTime(int value) { int s = value % 100; if (value <= 1) { s = 1; } value /= 100; int m = value % 100; int h = value / 100; Calendar c = Calendar.getInstance(); c.set(70, 0, 1, h, m, s); return new java.sql.Time(c.getTimeInMillis()); } }