struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wojciech Ciesielski" <wciesiel...@f1.pl>
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();
cal.setTimeInMillis(0);
cal.setTime(dateFormatTime.parse(timeString));
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?

TIA



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message