DZone Forums
Go Back   DZone Forums > Community > Languages & Frameworks > Java
Reload this Page String to formatted date
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Apr 2008
Default String to formatted date - 04-22-2008, 12:02 PM

SimpleDateFormat df = new SimpleDateFormat("EEE MMM d HH:mm:ss zzz yyyy");
SimpleDateFormat df1 = new SimpleDateFormat("dd MMM yyyy");
Date d1 =null;
String formattedDate=null;
try {
d1=df.parse("Tue Apr 22 21:03:48 IST 2008");
formattedDate =df1.format(d1);

} catch (ParseException e) {

e.printStackTrace();
}
System.out.println(formattedDate);
Reply With Quote
  (#2 (permalink)) Old
Member
 
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Apr 2008
Location: Sydney
Default 04-29-2008, 11:03 PM

what are you trying tosay
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection String For Microsoft SQLServer jo90way Microsoft SQL Server 0 01-12-2009 06:14 AM
date chooser help from date and to date sahuabinash Java 0 04-28-2008 02:30 AM
String and Arry Problem farakhkhan@yahoo.com Java 2 04-14-2008 02:54 AM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com