Try like this:-
Timestamp objTimestamp = getTimestamp("date_time")
Calendar objCalendar = Calendar.getInstance();
objCalendar.setTime(objTimestamp.getDate());
int year = objCalendar.get(Calendar.YEAR);
int month = objCalendar.get(Calendar.MONTH);
int date = objCalendar.get(Calendar.DATE);
int hour = objCalendar.get(Calendar.HOUR_OF_DAY);
int minute = objCalendar.get(Calendar.MINUTE);
and so on you check the API of Calendar class.
-----Original Message-----
From: Gading [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 27, 2002 1:07 PM
To: [EMAIL PROTECTED]
Subject: Date and time parser
Hi,
I have a timestamp object, obtain from DB using getTimestamp("date_time").
output is something like "2002-05-27 14:17:00".
How to get year, month, date, hour and minute in string (or int is also ok)?
===========================================================================
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://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.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://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com