Results 1 to 3 of 3

Thread: [RESOLVED] Change the system date format.

  1. #1

    Thread Starter
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Resolved [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

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    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

  3. #3

    Thread Starter
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    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
  •  



Click Here to Expand Forum to Full Width