Subtracting the Date in Java This question may seem similar with others hut actually it'snot the same case This code will return the difference in days between two dates but it doesn't return a negative number 0 Date currentdate-calendargetCurrentDate Date referencedate = calendar getDate long math-Mathabs currentdategetTime - referencedategetTime Systemoutprintlnresult I want to get a negative number n order to know if the current date is being subtracted from a past date or a future date How to make this code return a negative number as well? OBS I can't use Dateafter or any other method from javautilDate because the framework I'nm working with doesn't allow me to use those methods because it has its own Date class java validation date datetime datepicker share edit asked 14 mins ago Rafa 116 6 have you tried giving a thought to use Joda which is a datetime library exclusively - Satya 12 mins ago 4 I wonder what Mathabs does shmosel 12 mins ago add a comment A funny thing I found while ago on Stackoverflow Meme

found @ 31 likes ON 2019-02-28 07:27:31 BY ME.ME

source: tumblr