Hi Everybody,
Here is the Solution for Date & Time which sets to proper time zone! Enjoy!
class testDate
{
public static void main(String[] args)
{
TimeZone tz = TimeZone.getDefault();
Date date = new Date();
System.out.println("Default Date.toString(): " + date);
SimpleDateFormat format = new SimpleDateFormat("MMMMM dd, yyyy KK:mm
aa");
format.setTimeZone(tz);
System.out.println("Custom 1: " + format.format(date));
format.applyPattern("MM/dd/yyyy");
System.out.println("Custom 2: " + format.format(date));
format.applyPattern("hh:mm:ss z MM.dd.yyyy G");
System.out.println("Custom 3: " + format.format(date));
DateFormat fmt =
DateFormat.getDateInstance(DateFormat.FULL,Locale.UK);
System.out.println("Custom 4: " + fmt.format(date));
}
}
For Windows 2000 users
1. Select Start -> Settings -> Control Panel -> Regional Options
2. A window will display several tabs. Look for the General tab.
3. Set the locale to this indicator : (English United Kingdom)
4. Select the input locales tab.
5. Make sure that the data in the list box contains English (United
Kingdom)
6. Select the Apply then OK button.
Arshad.
subramanian Athimoolam wrote:
> hi
>
> suppose i want to stroe the date in to the data base (oracel)
> iam using formate to_date("+ +" ,'dd-mm-yy' );
>
> the same way i am retriveing i want to display date, time
> in my jsp page.
>
> i am using the following function
>
> java.util.date d=rs.getDate(msgdate);
> java.util.date d1=rs.getTime(msgdate);
>
> it will displaying full time like 12:14:24 here i want to display
> only hours and minutes.
>
> [ i will try getHours , but its not working ]
>
> how can i do it.. give me suggestion.
> thanks
>
> subu
>
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> 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
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
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