当前位置:网站首页>joda. Time get date summary
joda. Time get date summary
2022-06-25 06:43:00 【Flying page】
1、 Get the current date and yesterday's date ( Format yyyy-MM-dd)
@Test
public void testJodaTime(){
LocalDate localDate = new LocalDate();
System.out.println(localDate.toString());// Get current date 2022-06-23
LocalDate yesterday = localDate.plusDays(-1);// Push forward one day , Get yesterday's date
System.out.println(yesterday.toString());// 2022-06-22
}

2、 Get a specific year 、 month 、 Japan
@Test
public void testJodaTime(){
DateTime dateTime = new DateTime();
int day = dateTime.getDayOfMonth();
int month = dateTime.getMonthOfYear();
int year = dateTime.getYear();
System.out.println(" It's today "+ day +" Number ");
System.out.println(" Now it is "+ month +" month ");
System.out.println(" Now it is "+ year +" year ");
}

边栏推荐
- Keil debug view variable prompt not in scope
- The process of making wooden barrels with 3DMAX software: a three-step process
- How to record a database [closed] - how to document a database [closed]
- 2022 biological fermentation Exhibition (Jinan), which is a must read before the exhibition. The most comprehensive exhibition strategy will take you around the "fermentation circle"
- 原子Alpha开发板--SD卡和emmc烧录工具
- Face++ realizes face detection by flow
- Microsoft issued a document to celebrate Net 20th anniversary!
- Leetcode 2163. Minimum difference of sum after element deletion
- Derivation of sin (a+b) =sina*cosb+sinb*cosa
- 使用OpenGL绘制shp文件
猜你喜欢
![Analysis of China's food cold chain logistics, output of quick-frozen noodles and rice products and operation of major enterprises in 2021 [figure]](/img/66/f723dc48a1009a503f521c4d81c306.jpg)
Analysis of China's food cold chain logistics, output of quick-frozen noodles and rice products and operation of major enterprises in 2021 [figure]

【2022黑马程序员】SQL优化

What is cloud primordial?
![Analysis on the scale of China's smart airport industry in 2020: there is still a large space for competition in the market [figure]](/img/cd/c8be09eca7b41407b0ca1f3b4f3fe8.jpg)
Analysis on the scale of China's smart airport industry in 2020: there is still a large space for competition in the market [figure]

Uncaught TypeError: Cannot read properties of undefined (reading ‘prototype‘)

How two hosts in different network segments directly connected communicate

Single lithium battery 3.7V power supply 2x12w stereo boost audio power amplifier IC combination solution
![[speech discrimination] discrimination of speech signals based on MATLAB double threshold method [including Matlab source code 1720]](/img/36/ad86f403b47731670879f01299b416.jpg)
[speech discrimination] discrimination of speech signals based on MATLAB double threshold method [including Matlab source code 1720]

sin(a-b)=sina*cosb-sinb*cosa的推导过程

DataX tutorial (10) - hot plug principle of dataX plug-in
随机推荐
ARM processor operating mode
Coffee script unmatched outent error
Cloning and importing DOM nodes
sin(a-b)=sina*cosb-sinb*cosa的推导过程
Query process of MySQL secondary index
DNS domain name system
Metauniverse in 2022: robbing people, burning money and breaking through the experience boundary
燕京啤酒何以至此?
Ht7180 3.7V L 12v/2a built in MOS high current boost IC solution
Record of friend guide
Sleep quality today 67 points
ASP. Net core - encrypted configuration in asp NET Core
JD 8 fleet stores search history, deletes history, clears history (not finished)
Ht81293 built in adaptive dynamic boost 20W mono class D power amplifier IC solution
2022 AI trend 8 forecast!
Is the number of indexes in a table the more the better?
Understand what MTU is
JD 7 head search navigation layout
ASP. Net core - Safety of asynclocal in asp NET Core
TorchServe避坑指南