FavoriteNishanth Mandala (LastPass) asked in #ApexMar 29, 2016, 12:42 PMCalculate number of days between two datetime values in apexCould someone help me out with this? integer dt1 = day( datevalue(cc1.ClosedDate) ) - today();3 answersSortSort by DateSort by Most HelpfulSort by DateLoad more comments...John Pipkin (OpFocus, Inc)Mar 29, 2016, 12:54 PMRamshah, Use the daysBetween method in the date class:Integer dt1 = (system.today()).daysBetween(Date.valueOf(cc1.ClosedDate)); Add a commentWrite an answer...BoldItalicUnderlineStrikethroughBulleted ListNumbered ListAdd linkCode blockInsert imageAttach filesLink URLCancelSave0/9000Reply
John Pipkin (OpFocus, Inc)Mar 29, 2016, 12:54 PMRamshah, Use the daysBetween method in the date class:Integer dt1 = (system.today()).daysBetween(Date.valueOf(cc1.ClosedDate));