Traditional Culture Encyclopedia - Almanac inquiry - How to add alarm clock function to perpetual calendar program written by java
How to add alarm clock function to perpetual calendar program written by java
Import java.util.calendar;
Public class test date {
Public static final string [] weeks = {Tian, Yi, Er, San, Si, Wu and Liu};
Public static void main(String[] args) {
calendar c = calendar . getinstance();
Calendar. Year, 2011); //20 1 1 year
Calendar. Month, 0); //Calendar class in //java//Month starts from 0, and 0 stands for January.
Calendar. DATE, 1); //No.1
Int day = c.get (calendar. Day of the week); //What day is it this week? 1 stands for Sunday ... 7 stands for Saturday.
System.out.println (new simple date format ("yyyy-MM-dd"). format(c . gettime()));
system . out . println(“week“+weeks【day- 1】);
}
}
Write the above test code as method parameters named year, month and day. Of course, calendars have many functions, such as the day of the week and the month of the year. ...
- Previous article:How do institutions manage retirement posts?
- Next article:20 12 12 9 is it auspicious to travel on October 26th of the lunar calendar?
- Related articles
- 1993 can a person born at 4 am on the fourth day of the ninth lunar month calculate his fate? What are the five missing elements in life?
- Jiri inquired about the name of the old calendar.
- Heavenly stems and earthly branches every day in the solar calendar.
- Da ji TV series on the Gregorian calendar 14
- When will it enter the dog days of 2023?
- 20 10 how about getting married on the 14th of the twelfth lunar month?
- What is the life of the baby born on the seventh day of the twelfth lunar month in 2022?
- When will you move the grave? What did you say?/Sorry?
- Dream of white hair, torches and flowers
- Is the god of wealth right or wrong?