Date Time Manipulation (DTM) Helper for JAVA, compatible for Spring Boot too.
- Manipulation day
- Manipulation Month
- Manipulation Year
- Manipulation Hour
- Manipulation Minute
- Manipulation Second
- Manipulation Milisecond
- Re-format Date (convert date to string)
- Convert String To Date/Datetime
- Java 11
- Spring Boot 2.4.2
- Download/copy file DTM.java to your own project
- Adjust
Package Path
in line 2 on file DTM.java - Done.
dtm.day(param).getTime();
Fill positive numbers on the Param
to add days (1,2,3, etc), and;
fill negative numbers on the Param
to subtract days (-1, -2, -3, etc)
DTM dtm = new DTM();
dtm.day(-1).getTime();
dtm.month(param).getTime();
Fill positive numbers on the Param
to add month (1,2,3, etc), and;
fill negative numbers on the Param
to subtract month (-1, -2, -3, etc)
DTM dtm = new DTM();
dtm.month(-1).getTime();
dtm.year(param).getTime();
Fill positive numbers on the Param
to add year (1,2,3, etc), and;
fill negative numbers on the Param
to subtract year (-1, -2, -3, etc)
DTM dtm = new DTM();
dtm.year(-1).getTime();
dtm.hour(param).getTime();
Fill positive numbers on the Param
to add hour (1,2,3, etc), and;
fill negative numbers on the Param
to subtract hour (-1, -2, -3, etc)
DTM dtm = new DTM();
dtm.hour(-1).getTime();
dtm.minute(param).getTime();
Fill positive numbers on the Param
to add minute (1,2,3, etc), and;
fill negative numbers on the Param
to subtract minute (-1, -2, -3, etc)
DTM dtm = new DTM();
dtm.minute(-1).getTime();
dtm.second(param).getTime();
Fill positive numbers on the Param
to add second (1,2,3, etc), and;
fill negative numbers on the Param
to subtract second (-1, -2, -3, etc)
DTM dtm = new DTM();
dtm.second(-1).getTime();
dtm.milisecond(param).getTime();
Fill positive numbers on the Param
to add milisecond (1,2,3, etc), and;
fill negative numbers on the Param
to subtract milisecond (-1, -2, -3, etc)
DTM dtm = new DTM();
dtm.milisecond(-1).getTime();
dtm.reFormat(param1, param2);
Fill the Param1
with Date data type value, and;
fill the Param2
with Date string pattern
DTM dtm = new DTM();
dtm.reFormat(new Date(),"ddMMyyyy");
dtm.reFormat(dtm.day(-7).getTime(),"ddMMyyyy");
dtm.stringToDate(param1, param2);
Fill the Param1
with String Date, and;
fill the Param2
with Date string pattern, but the pattern date must be the same with String Date on Param1
(Ex: String Date "31/12/1998"
, Pattern from the string date is "dd/MM/yyyy"
)
DTM dtm = new DTM();
dtm.stringToDate("31/12/1998","dd/MM/yyyy");
Icon by Flaticon.com