struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wojciech Ciesielski" <>
Subject a little bit OT: Calendar misbehaviour
Date Mon, 19 Sep 2005 09:55:49 GMT
Hi there,

I try to parse some input from HTML form with 

Java.sql.Timestamp toReturn;
SimpleDateFormat dateFormatTime("HH:mm");
Calendar cal = new GregorianCalendar();
toReturn = new Timestamp(cal.getTimeInMillis());

The point is, that getTimeInMillis() is returning 0 if timeString contains
only minutes (like "00:20") while cal.getTime().toString returns properly
"Thu Jan 01 00:10:00 CET 1970".

Why is it so? How can I initialize that Timestamp with such a string if this
approach does not work?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message