Here you can find the source of toCalendar(final Timestamp ts)
Parameter | Description |
---|---|
ts | Timestamp to convert. |
public static Calendar toCalendar(final Timestamp ts)
//package com.java2s; /*/*w ww . jav a 2 s .c o m*/ $Id$ Copyright (C) 2009-2010 Virginia Tech. All rights reserved. SEE LICENSE FOR MORE INFORMATION Author: Middleware Services Email: middleware@vt.edu Version: $Revision$ Updated: $Date$ */ import java.sql.Timestamp; import java.util.Calendar; public class Main { /** * Converts a SQL timestamp into a {@link Calendar}. * * @param ts Timestamp to convert. * * @return Equivalent calendar. */ public static Calendar toCalendar(final Timestamp ts) { final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(ts.getTime()); return cal; } }