You need to sign in to do that
Don't have an account?

Subtracting days in apex classes
Hi,
I have a requirement to find the Friday of this week and then find the Friday before 13 weeks. How can I do that. To find the current friday I did the following
this.dateView.Pack__Start_Date__c = date.today().toStartOfWeek().addDays(6);
Now how can I get the 13 week before date? as there is no date subtraction function here. So please tell me how can it be done in Apex classes
then i guess this should work....
addDays(-91)....this will take care of leap year....as it only counts the days.... i dont know whether there is any other way.... but you may go on to explore and please let me know if it is posssible by some other way...
All Answers
yes you can...
this.dateView.Pack__Start_Date__c.addDays(-13);
then i guess this should work....
addDays(-91)....this will take care of leap year....as it only counts the days.... i dont know whether there is any other way.... but you may go on to explore and please let me know if it is posssible by some other way...