You need to sign in to do that
Don't have an account?
DJP1S
Getting the date portion of the datetime field LastModifiedDate
If I write a string like this:
priorityList += '- ' + writePriority[i].CreatedBy.Name + ' - ' + writePriority[i].LastModifiedDate + ': ' + writePriority[i].Priority_Notes__c;
What would be the best way to get the modified date to only display 2012-09-14, without the time following?
I would suggest instead:
Good luck!
All Answers
Try something like this to format.
*public static Date StringToDate(String s){
//XML Date String is in the format dd/mm/yyyy
String[] stringDate = s.split('-');
Integer d = Integer.valueOf(stringDate[0]);
Integer m = Integer.valueOf(stringDate[1]);
Integer y = Integer.valueOf(stringDate[2]);
return date.newInstance(y,m,d);
}
I would suggest instead:
Good luck!
Thank you, John. That works great!