-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDateConstruct.java
38 lines (28 loc) · 1.02 KB
/
DateConstruct.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
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class DateConstruct { // to create methods that gives a reminder when things expire
private final Date exprDate;
public DateConstruct(Date exprDate) {
this.exprDate = exprDate;
}
// add comparison method
// public Date StringConvert (String exprDate) {
// SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy");
// //Parsing the given String to Date object
// Date date = formatter.parse(exprDate);
// return date;
// }
// public static void main(String args[]) throws ParseException {
// String date_string = "01-01-2022";
// //Instantiating the SimpleDateFormat class
// SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy");
// //Parsing the given String to Date object
// Date date = formatter.parse(date_string);
// System.out.println("Date value: "+date);
// }
//
// public String () {
//
// }
}