A simple example of Calendar class

xiaoxiao2021-04-05  241

import java.util.Calendar; import java.util.GregorianCalendar; public class CalendarTest {public static void main (String [] args) {GregorianCalendar d = new GregorianCalendar (); // d is defined as the current date int today = d.get (Calendar.day_of_month; int month = d.Get (Calendar.Mont); D.SET (Calendar.day_of_month, 1); // Set the current date D start month INT weekday = d.Get (Calendar.day_of_week; system); system .out.println ("Sun Mon Tue Wed Thu Fri Sat"); // Print Calendar FOR (INT I = Calendar.Sunday; I

转载请注明原文地址:https://www.9cbs.com/read-132003.html

New Post(0)