TCLUG Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG-DEVEL:197] Date



Erick Stohr wrote:
> 
> How would I take in a date from a servlets req parameter? They come in
> as strings right, is there a way to cast/convert it to a date? I am
> using Oreillys ParameterParser and am checking out the web site as I
> send this. Thanks.
> 
> erick
> 
> --
> _______________________________________________
> 
> Erick Stohr - PageLab Network, Inc.
> mailto:erick@pagelab.net  http://pagelab.net
> 
> Your search-to-sale global e-commerce solution!
> 
> Toll free 1-800-447-0607
> Voice 612-362-9224
> Fax 612-362-9227
> 43 Main Street SE, Suite 228
> Minneapolis, Minnesota 55414
> _______________________________________________
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tclug-devel-unsubscribe@mn-linux.org
> For additional commands, e-mail: tclug-devel-help@mn-linux.org

Need to use DateFormat.

java.text.DateFormat t_dateFormat =
java.text.DateFormat.getDateInstance(java.text.DateFormat.SHORT);
java.util.Date t_date =
t_dateFormat.parse(aRequest.getParameter("myDate");

myDate is a String within the request header that looks like this:
12/31/2000

-- 
Perry Hoekstra
Talent Software Services
dutchman@mn.uswest.net

"I don't see much sense in that," said Rabbit.
"No," said Pooh humbly, "there isn't. But there was going to be when I
began it. It's just that something happened to it along the way."