Results 1 to 2 of 2

Thread: modern month name using java program

  1. #1
    RodríguezBrown is offline Senior Member
    Join Date
    Dec 2009
    Posts
    322
    Rep Power
    3

    Default modern month name using java program

    How to get the modern month name using java program?

    How to get the current month name using java program? I tried different methods but none of them worked out. Any suggestion would be highly appreciated.
    Last edited by RodríguezBrown; 01-22-2010 at 06:18 PM.

  2. #2
    WilsonMartin is offline Senior Member
    Join Date
    Dec 2009
    Posts
    319
    Rep Power
    3

    Default

    Follow the given code which is helpful for you.

    import java.text.DateFormat;
    import java.util.Date;

    public class DateFormatExample1 {

    public static void main(String[] args) {

    Date n = new Date();
    System.out.println(" 1. " + n.toString());

    System.out.println(" 2. " + DateFormat.getInstance().format(n));


    System.out.println(" 3. " + DateFormat.getTimeInstance().format(n));
    System.out.println(" 4. " +
    DateFormat.getDateTimeInstance().format(n));


    System.out.println(" 5. " +
    DateFormat.getTimeInstance(DateFormat.SHORT).forma t(n));
    System.out.println(" 6. " +
    DateFormat.getTimeInstance(DateFormat.MEDIUM).form at(n));
    System.out.println(" 7. " +
    DateFormat.getTimeInstance(DateFormat.LONG).format (n));


    System.out.println(" 8. " + DateFormat.getDateTimeInstance(
    DateFormat.SHORT, DateFormat.SHORT).format(n));
    System.out.println(" 9. " + DateFormat.getDateTimeInstance(
    DateFormat.MEDIUM, DateFormat.SHORT).format(n));
    System.out.println("10. " + DateFormat.getDateTimeInstance(
    DateFormat.LONG, DateFormat.LONG).format(n));
    }
    }

Similar Threads

  1. How to initiate Internet program with Java
    By WilsonMartin in forum Programming
    Replies: 0
    Last Post: 05-06-2010, 03:47 PM
  2. Scheduled task program in java
    By CoxWatson in forum Programming
    Replies: 1
    Last Post: 04-17-2010, 12:53 PM
  3. Java program
    By MoralesWard in forum Programming
    Replies: 1
    Last Post: 02-02-2010, 05:16 PM
  4. statement in java program
    By PetersonClark in forum Programming
    Replies: 1
    Last Post: 01-27-2010, 02:50 PM
  5. Write program on palindrome in java
    By MoralesMyers in forum Programming
    Replies: 2
    Last Post: 01-14-2010, 06:24 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48