Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-07-2007, 12:04 PM
Member
 
Join Date: Apr 2007
Location: Singapore
Posts: 30
yuchuang is on a distinguished road
Send a message via MSN to yuchuang
Formatting the date
I would like to ask if anyone knows how to format the date such that it shows Thursday, November 30, 2006.

I'm currently using this line of code to format my date but i want it to display to the one as above.
DateFormat fileDateFormat = new SimpleDateFormat("dd/MMM/yyyy");

is it possible to do that using simple date format?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-07-2007, 04:24 PM
Member
 
Join Date: Apr 2007
Location: Indiana
Posts: 84
pegitha is on a distinguished road
Send a message via Skype™ to pegitha
This code:
Code:
Date now = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("EEEEEE, MMMM dd, yyyy" ); System.out.println(sdf.format(now));
will out put this:
Monday, May 07, 2007
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-07-2007, 06:56 PM
Member
 
Join Date: Apr 2007
Location: Singapore
Posts: 30
yuchuang is on a distinguished road
Send a message via MSN to yuchuang
Thanks! It has showed what i wanted it to show but what does the EEEEE means?
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 05-07-2007, 06:58 PM
Member
 
Join Date: Apr 2007
Location: Indiana
Posts: 84
pegitha is on a distinguished road
Send a message via Skype™ to pegitha
If you look at the API
SimpleDateFormat (Java 2 Platform SE v1.4.2)
you will see that E prints the day of the week, just like yyyy prints the year.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 05-07-2007, 07:00 PM
Member
 
Join Date: Apr 2007
Location: Singapore
Posts: 30
yuchuang is on a distinguished road
Send a message via MSN to yuchuang
ohh.. i see.. i understand now. Thanks. I'm really a newbie in Java.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 05-07-2007, 07:08 PM
Member
 
Join Date: Apr 2007
Location: Indiana
Posts: 84
pegitha is on a distinguished road
Send a message via Skype™ to pegitha
No problem. I am happy to help.I have a million or more questions about java myself.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting a number to currency Java Tip java.text 0 04-16-2008 11:59 PM
Difference between current date and anothe date vijay balusamy New To Java 1 04-16-2008 05:15 PM
formatting.. sireesha New To Java 10 01-07-2008 08:51 AM
formatting String bugger New To Java 1 11-16-2007 08:27 PM
Correct Number formatting paul New To Java 1 08-07-2007 05:59 AM


All times are GMT +3. The time now is 12:15 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org