当前位置:网站首页>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);}
边栏推荐
- LocalDate加减操作及比较大小
- 点云DBSCAN聚类(MATLAB,非内置函数)
- Ambiguous method call.both
- SQALE 是什么
- 组件传值 provide/inject
- VS QT - ui does not display newly added members (controls) || code is silent
- 安全20220722
- Redis implements distributed locks
- Recursive query single table - single table tree structure - (self-use)
- [C language] Preprocessing operation
猜你喜欢
递归查询单表-单表树结构-(自用)
How to develop a high-quality test case?
TCP详解(二)
VS QT - ui does not display newly added members (controls) || code is silent
Daily practice of LeetCode - palindrome structure of OR36 linked list
数据库实现分布式锁
No qualifying bean of type 问题
LeetCode每日一练 —— OR36 链表的回文结构
【动态规划】连续子数组的最大和
LeetCode每日一练 —— 138. 复制带随机指针的链表
随机推荐
Golang中的addressable
The use of beforeDestroy and destroyed
LeetCode简单题之找到和最大的长度为 K 的子序列
Database implements distributed locks
errno错误码及含义(中文)
addressable in Golang
type_traits元编程库学习
STM32 problem collection
Automation strategies for legacy systems
下载jar包的好地方
3.5 】 【 Cocos Creator slow operating system to stop all animations
SocialFi 何以成就 Web3 去中心化社交未来
[C language] General method of expression evaluation
IDEA comment report red solution
进程间通信
[Compilation principle] Design principle and implementation of recursive descent parsing
选好冒烟测试用例,为进入QA的制品包把好第一道关
分布式系统架构需要解决的问题
False positives and false negatives in testing are equally worthy of repeated corrections
Use of QML