|
-
Jun 10th, 2007, 10:30 PM
#1
Thread Starter
PowerPoster
[RESOLVED] Change the system date format.
One of my Java applications I want to get the system date and time. Say I’m going to use the following class to do that.
Code:
import java.util.*;
public class Get_System_Time
{
public static void main(String[] arguments)
{
Date cDate = new Date();
// Current date
System.out.println(cDate);
}
}
Output is,
Wed May 30 08:27:37 LKT 2007
Actually I’m worried about only the date (Wed May 30). But I want to change it little, print the full date, like Wednesday May 30. How can I do that?
“victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha
-
Jun 10th, 2007, 11:11 PM
#2
Re: Change the system date format.
Take a look at the Calendar class. I think it has what you are looking for
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jun 10th, 2007, 11:17 PM
#3
Thread Starter
PowerPoster
Re: Change the system date format.
Exactly that what I want. Thanks. Lot to read. I check it out and if any issue, come back here.
“victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|