当前位置:网站首页>LocalDate addition and subtraction operations and comparison size
LocalDate addition and subtraction operations and comparison size
2022-07-31 03:32:00 【UlricaQ】
LocalDate for addition and subtraction, code and results:
Code:
public void test() {LocalDate today = LocalDate.now();System.out.println("today:"+today);// today plus five daysLocalDate plusDays = today.plusDays(5);System.out.println("today plus 5 days: "+plusDays);// today minus 5 daysLocalDate minusDays = today.minusDays(5);System.out.println("today minus 5 days: "+minusDays);// Determine if today is before plusDays, return a boolean valueboolean before = today.isBefore(plusDays);System.out.println("Determine whether today is before plusDays: "+before);boolean after = today.isAfter(plusDays);System.out.println("Determine whether today is after plusDays: "+after);// Compare today and plusDays, the result returns the value of today-plusDaysint i = today.compareTo(plusDays);System.out.println("Today and plusDays compare the size: "+ i);}
边栏推荐
猜你喜欢
大小端模式
With 7 years of experience, how can functional test engineers improve their abilities step by step?
$attrs/$listeners
立足本土,链接全球 | 施耐德电气“工业SI同盟”携手伙伴共赴未来工业
Database implements distributed locks
LeetCode中等题之分数加减运算
TCP详解(二)
【C语言】预处理操作
Mysql 45 study notes (twenty-four) MYSQL master-slave consistency
The distance value between two arrays of LeetCode simple questions
随机推荐
[Compilation principle] Lexical analysis program design principle and implementation
The use of beforeDestroy and destroyed
[Dynamic programming] Maximum sum of consecutive subarrays
安全20220709
Mysql 45 study notes (23) How does MYSQL ensure that data is not lost
安全20220718
IDEA 注释报红解决
The els block moves the boundary to the right, and accelerates downward.
组件传值 provide/inject
Automation strategies for legacy systems
注解用法含义
【Cocos Creator 3.5】缓动系统停止所有动画
【C语言】预处理操作
解析小结—自用
Detailed explanation of TCP (1)
The BP neural network
[Godot][GDScript] 2D cave map randomly generated
[C language] Preprocessing operation
RESTful api接口设计规范
浅识Flutter 基本组件之CheckboxListTile组件