You need to sign in to do that
Don't have an account?
JCompliance
Getting Method Does not exist or incorrect signature [Date].format(string)
Can someone help me with this error?
I just want the date to display "MM/DD/YYY"
Below is my code:
public class ArmActivityEvent { public Arm_Activity__c aaev; public String formatedDate; public ArmActivityEvent(Arm_Activity__c aa) { aaev= aa; Datetime endd = aa.Actual_Scheduled_Date_Time__c; formatedDate = a.Actual_Scheduled_Date_Time__c.format('MM/DD/YYYY'); system.debug(formatedDate); } public Arm_Activity__c getaaev() { return aaev; } public String getFormatedDate() { return formatedDate; } }
Thank you for any assistance you can provide.
JP
This looks like the field named Actual_Scheduled_Date_Time__c is actually a date field rather than a date/time.
That is correct. It is only Date. The field name is misleading.
So in that case you can't use the format method, as that is only available for datetime fields.
You'll need to turn your date into a datetime, something like: