Here you can find the source of toDate(int value)
public static java.sql.Date toDate(int value)
//package com.java2s; /**//w w w. j a v a 2 s.c o 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.Date toDate(int value) { int d = value % 32; value >>>= 5; int m = value % 16; int y = value >> 4; Calendar cal = Calendar.getInstance(); cal.clear(); cal.set(y, m - 1, d); return new java.sql.Date(cal.getTimeInMillis()); } }