Here you can find the source of createTimestamp(int month, int day)
public static Timestamp createTimestamp(int month, int day)
//package com.java2s; //License from project: Open Source License import java.sql.Timestamp; import java.util.Calendar; public class Main { public static Timestamp createTimestamp(int year, int month, int day, int hour, int minute, int second) { Calendar c = Calendar.getInstance(); c.set(year, month - 1, day, hour, minute, second); c.set(Calendar.MILLISECOND, 0); return new Timestamp(c.getTimeInMillis()); }//from w w w. j a v a 2s .co m public static Timestamp createTimestamp(int year, int month, int day, int hour, int minute) { Calendar c = Calendar.getInstance(); c.set(year, month - 1, day, hour, minute, 0); c.set(Calendar.MILLISECOND, 0); return new Timestamp(c.getTimeInMillis()); } public static Timestamp createTimestamp(int year, int month, int day) { Calendar c = Calendar.getInstance(); c.set(year, month - 1, day, 0, 0, 0); c.set(Calendar.MILLISECOND, 0); return new Timestamp(c.getTimeInMillis()); } public static Timestamp createTimestamp(int month, int day) { Calendar c = Calendar.getInstance(); c.set(c.get(Calendar.YEAR), month - 1, day, 0, 0, 0); c.set(Calendar.MILLISECOND, 0); return new Timestamp(c.getTimeInMillis()); } }