Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 9968 | Replies: 3
![]() |
hi nccliang,
Probably this helps :
[HTML]
import java.util.*;
import java.text.*;
class TestDate
{
public static void main(String args[])
{
Date date=new Date();
SimpleDateFormat sdf=new SimpleDateFormat("MM/dd/yy");
String strDate=sdaf.format(date);
System.out.println(strDate);
}
}
[/HTML]
regards
Srinivas
Probably this helps :
[HTML]
import java.util.*;
import java.text.*;
class TestDate
{
public static void main(String args[])
{
Date date=new Date();
SimpleDateFormat sdf=new SimpleDateFormat("MM/dd/yy");
String strDate=sdaf.format(date);
System.out.println(strDate);
}
}
[/HTML]
regards
Srinivas
We come to love not by finding a perfect person, but by learning to see an imperfect person perfectly.
-Sam Keen, from To Love and Be Loved
-Sam Keen, from To Love and Be Loved
•
•
Join Date: Nov 2004
Location: Netherlands
Posts: 5,752
Reputation:
Rep Power: 19
Solved Threads: 200
If your Java skills are weak you need to improve those skills, not ask people for ready made solutions.
Get a good book (or 2, or 10, or like me buy them until you run out of money), read the API docs, and experiment.
DateFormat, Calendar, and Date together are extremely powerful but that makes the system a tad complex.
Aren't we lucky it's so well documented in the API docs then?
Get a good book (or 2, or 10, or like me buy them until you run out of money), read the API docs, and experiment.
DateFormat, Calendar, and Date together are extremely powerful but that makes the system a tad complex.
Aren't we lucky it's so well documented in the API docs then?
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Linear Mode