import java.util.Date;
import java.text.SimpleDateFormat;
import com.github.daniellavoie2.moment.Moment;
public class MomentExample {
public static void main(String[] args) {
Date date = new SimpleDateFormat("yyyy-MM-dd").parse("2022-01-01");
Moment moment = Moment.moment(date);
String formattedDate = moment.format("yyyy-MM-dd");
System.out.println("Formatted date: " + formattedDate);
Moment addedMoment = moment.add(1, "years");
String addedDate = addedMoment.format("yyyy-MM-dd");
System.out.println("Added date: " + addedDate);
Moment anotherMoment = Moment.moment("2022-12-31", "yyyy-MM-dd");
long daysDifference = moment.diff(anotherMoment, "days");
System.out.println("Days difference: " + daysDifference);
}
}