• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I change my Date format?

 
Elahe Shafie
Ranch Hand
Posts: 291
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,
My Date format is like:
Wed Dec 19 16:26:37 PST 2001
Because I defined it like:
import java.util.Date;
...
Date today=new Date();
strSubmittedDate = today.toString();
How can I get the shorter text like "Wed Dec 19"
what should I add to the code?
Please help...
Thanks,
Elahe
 
James Swan
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the API docs for java.text.SimpleDateFormat
 
Elahe Shafie
Ranch Hand
Posts: 291
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jim for quick reply but I couldn't find any example for MEDIUM foramt to get idea how I can implement it?!!
any advice?
Elahe
 
James Swan
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok this produces a date is the format of your above example.

Btw, my name is James not Jim
 
Elahe Shafie
Ranch Hand
Posts: 291
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works...
Thanks James
 
aminur rashid
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is in name James .Haven't u heared A rose is a rose even when u call it by some other name
N'joy
 
Elahe Shafie
Ranch Hand
Posts: 291
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That was the good one...
 
James Swan
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is in name James .Haven't u heared A rose is a rose even when u call it by some other name
N'joy
--------------------
Regards
Aminur

Bob, I am flattered by your kind words and impressed by your wisdom.
Thanks again
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic