Basically get a Calendar instance using Calendar.getInstance() then use the
Calendar.setTime() [strangely named] method to set in the Date (either
java.util.Date or java.sql.Date/Time/Timestamp will do). Once that is done
you can use the Calendar.get() method to get any piece you want.
Calendar.get(Calendar.DAY_OF_WEEK) will give you the Day of the Week Number.
(*Chris*)
----- Original Message -----
From: "Rice, David" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 16, 2001 3:33 PM
Subject: Re: [JSP-INTEREST] Using DATE and CALENDAR objects...
> Chris,
>
> Unfortunately, I do have to parse dates to extract needed information. The
app I'm building is a log analysis tool that expects not only the complete
timestamp, but also needs the day_of_week, day_of_month, et cetera, broken
out. We take that information, along with other environment variables to
compile access/usage reports for the higher ups. And I have to use
PreparedStatements due to the fact that I'm doing joined-table inserts. I
just haven't figured out how to incorporate the DATE/CALENDAR stuff into
them yet... ;)
>
> I've been through the docs at:
http://java.sun.com/products/jdk/1.2/docs/api/ but they're more confusing
than anything and provide no examples that I can decipher at this point. I
also went to the tutorial suggested by Geert as well but that is much more
convoluted than what I'll need, I'm thinking.
>
> Nonetheless, I appreciate all the feedback and help!
>
> David
> --------------------------
>
> -----Original Message-----
> From: Chris Pratt [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 16, 2001 5:16 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Using DATE and CALENDAR objects...
>
>
> The best way is to use PreparedStatement's and the
> setDate/setTime/setTimestamp methods. Then you don't have to parse the
> dates at all.
> (*Chris*)
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets