Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Pro JSP
|
Pro JSP Advanced JSP coding questions. Beginning questions will be redirected to the Beginning JSP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro JSP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 21st, 2006, 01:12 AM
Registered User
 
Join Date: Jul 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to set the date

Dear all,

how can i change the date format from 26-06-2005 to Fri June 26 15:34:30 UTC + 0800 2005 Date format.



Any help will be highly appreciated..

Thanks in advance..
 
Old July 21st, 2006, 11:00 AM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

import java.text.*;
import java.util.*;

DateFormat origFormat = new SimpleDateFormat("dd-MM-yyyy");
Date d = origFormat.parse("26-06-2005");
DateFormat newFormat = new SimpleDateFormat("E MMM dd HH:mm:ss z Z yyyy");
System.out.println(newFormat.format(d));

Catch exceptions ...

Jon Emerson
http://blogs.adobe.com/jon.emerson/





Similar Threads
Thread Thread Starter Forum Replies Last Post
XPath: set operation with a disjoint node set rich_unger XSLT 7 May 6th, 2008 09:24 AM
How can I set system time & date in VB.net ? mike123abc Pro VB.NET 2002/2003 1 April 27th, 2007 10:00 AM
how i set charcter set to a connection yoord BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 April 23rd, 2005 07:47 AM
How to set DOM character set sonicDace XML 0 May 27th, 2004 08:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.