Print the Windows System calendar format

Source: Internet
Author: User

*    print Windows System calendar format  *  *     2016 April 16    Saturday    107 days of this year  * *      day      one       Two      three      four      five      six  *              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 * *   date class    Calendar class   dateformat Class  simpledateformat class application and Practice  * */ import  Java.text.simpledateformat;public class myCalendar {public static void main (String[] args)  {date d=new date (); Showmonth s=new showmonth (); Simpledateformat sdf=new simpledateformat ("yyyy mm month DD Day   E   year D Day"); System.out.println (Sdf.format (d)); System.out.println ("t \ t two \ \ Three \ Four \ five \ t six"); S.show ();}
Import java.util.calendar;public class showmonth {   calendar c= Calendar.getinstance ();//Gets the maximum number of days per month     int sumdays =c.getactualmaximum ( Calendar.date);        public void show () {     Set the current date to the first day (1st)     c.set (calendar.day_of_month, 1);       //get Current (1st) is the day of the Week     int a = c.get (Calendar.day_of_week);     //Print the space before the current (1st) Date       for (int i=1; i<a; i++)  {              system.out.print ("\ T ");          }             //Print the date of each month       for (int i=1;i<=sumdays;i++ ) {     &nbsP System.out.print (i+ "\ t");       //if it is Saturday, newline output        if (C.get (Calendar.day_of_week) ==calendar.saturday) {      system.out.println ();       }    //  increase the date by one day after each output date        c.add (calendar.day_of_month, 1);      }         }    }


Print the Windows System calendar format

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.