You need to sign in to do that
Don't have an account?
kittu9
Difference between two dates
I have one date field tht is returning date as '2013-06-03'. I want to subtract this date with todays date.
Whn am trying for today's date using Date d = Date.today(); It is returing time also along with date. I want only date part. How to retrive only date part
1) datetime myDateTime = datetime.now();
Date d = myDateTime.date();
2) date tt = system.today();
string ss = tt.format();
Tried in differenct scenarios but getting time also can any one help me on this. Only wanto get the date part.
Joining_Date__c - Today () >= 25
This is the condition for me. Want to do this
As far as I know System / Date.today() does not include any timestamp, the Date object doesn't even have any time fields on it.
I've tried this block of code and it worked fine for date compares.
This is what gets spit out in my debug log:
08:23:05.038 (38242000)|USER_DEBUG|[2]|DEBUG|Printed Date:::07/06/2013
08:23:05.038 (38386000)|USER_DEBUG|[8]|DEBUG|Number Of Days Between::: 50
Did you try this ?
integer numberDaysDue = Obj.Joining_Date__c.daysBetween(system.today());