-
Notifications
You must be signed in to change notification settings - Fork 8
/
App.java
24 lines (21 loc) · 1.7 KB
/
App.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import java.time.LocalDate;
class App{
public static void main(String[] args) {
LocalDate date = LocalDate.now();
date = date.plusYears(3);
System.out.println(date.getYear() + " - " + date.getMonthValue() + " - " + date.getDayOfMonth());
}
}
/*
import java.time.LocalDate; لاستدعاء الكلاس جاهز الذي يمكننا من خلالها حصول على التاريخ
------------------------------------------------------------------------------------------------------------
LocalDate.now() To get the current date - للحصول على التاريخ الحالي
getYear() To get the current year from date - للحصول على السنة الحالية من التاريخ
getMonthValue() To get the current month from date - للحصول على الشهر الحالي من التاريخ
getMonth() To get the name of the current month - للحصول على الاسم الشهر الحالي من التاريخ
getDayOfMonth() To get the current day of the month from date - للحصول على اليوم الحالي من الشهر الحالي
getDayOfYear() To get the current day of the month from date - للحصول على اليوم الحالي من السنة الحالية
------------------------------------------------------------------------------------------------------------
minusDays() To decrease days from the current date - للنقص ايام من التاريخ المحدد
plusDays() To increase days to the current date - للزيادة ايام إلى التاريخ المحدد
*/