当前位置:网站首页>Calendar common methods
Calendar common methods
2022-07-24 18:53:00 【Programming Altman】
package itheima_02;
import java.util.Calendar;
/public abstract void add (int field, int amount): According to calendar rules , Add or subtract the given calendar field... From the specified amount of time
public final void set (int year, int month, int date): Set the month, year and day of the current calendar /
public class CalendarDamo {
public static void main(String[] args) {
// Get calendar class object
Calendar c = Calendar.getInstance();
//public int get(int field): Returns the value of the given calendar field
// int year = c.get(Calendar.YEAR);
// int month = c.get(Calendar.MONTH) + 1;
// int date = c.get(Calendar.DATE);
// System.out.println(year + “ year ” + month + “ month ” + date + “ Japan ”);
//public abstract void add (int field, int amount): According to calendar rules , Add or subtract the given calendar field... From the specified amount of time
// demand 1:3 Years ago today
// c.add(Calendar.YEAR,-3);
//
// int year = c.get(Calendar.YEAR);
// int month = c.get(Calendar.MONTH) + 1;
// int date = c.get(Calendar.DATE);
// System.out.println(year + “ year ” + month + “ month ” + date + “ Japan ”);
// demand 2:10 Years later, 5 Days ago,
// c.add(Calendar.YEAR,10);
// c.add(Calendar.DATE, -5);
//
// int year = c.get(Calendar.YEAR);
// int month = c.get(Calendar.MONTH) + 1;
// int date = c.get(Calendar.DATE);
// System.out.println(year + “ year ” + month + “ month ” + date + “ Japan ”);
// public final void set (int year, int month, int date): Set the month, year and day of the current calendar
c.set(2048,11,11);
int year = c.get(Calendar.YEAR);
int month = c.get(Calendar.MONTH) + 1;
int date = c.get(Calendar.DATE);
System.out.println(year + " year " + month + " month " + date + " Japan ");
}
}
边栏推荐
- epoch,batch_ size
- JVM方法调用
- 引发0xC0000005内存违例几种可能原因分析
- Thread lifecycle and basic methods
- Getaverse, a distant bridge to Web3
- Ionic4 learning notes 1
- Mysql——》BufferPool相关信息
- Calling startActivity() from outside of an Activity context requires the FLAG_ ACTIVITY_ NEW_ TASK flag
- 8. = = and = = =?
- Valentine's Day gift ----- use her photos and our chat records to generate word clouds~
猜你喜欢

04-分布式资源管理系统YARN

Web

【微信小程序开发】自定义tabBar案例(定制消息99+小红心)

Data analysis of network security competition of national vocational college skills competition digital forensics-a

Today's sleep quality record 79 points

多线程与并发编程常见问题(未完待续)
![[today in history] July 24: caldera v. Microsoft; Amd announced its acquisition of ATI; Google launches chromecast](/img/7d/7a01c8c6923077d6c201bf1ae02c8c.png)
[today in history] July 24: caldera v. Microsoft; Amd announced its acquisition of ATI; Google launches chromecast

Mysqlworkbench performance analysis tool -- Performance dashboard

Mysql——》BufferPool相关信息

32-bit stack overflow advanced
随机推荐
2022 Hangzhou Electric Multi school first Dragon Slayer (dfs+ state compression)
Nftscan and port3 have reached strategic cooperation in the field of NFT data
Analysis of dropout principle in deep learning
matplotlib
Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag
暑期牛客多校1: I Chiitoitsu(期望dp,求逆元)
Analysis of several possible causes of 0xc0000005 memory violation
Hangdian multi School Game 1 question 3 backpack (XOR dp+bitset)
Redis data type
[Tkinter] common components (II)
[Tkinter] layout management and event system
Sqoop
Go Xiaobai implements a simple go mock server
Nacos简介和控制台服务安装
Tclsh array operation
Today's sleep quality record 79 points
32-bit stack overflow advanced
Latex数学公式
Ionic4 learning notes 4 -- add a tab page
PCI express physical layer - electrical part