+ Start a Discussion
Angela SchloederAngela Schloeder 

Date and Time format in Trigger

Hello Experts, 

I am trying to figure out how to get the DATE/TIME format to look like this: MM-DD-YYY HH:MM AM/PM. Currently it is all wrong, looking like this: 2016-10-11 19:20:33

Here is my code currently.

if(updateTask.Description != null){
                            updateTask.Description += '\n' + newTask.CreatedDate + ' ' + newTask.Description;
                        }
                        else{
                            updateTask.Description = newTask.CreatedDate + ' ' + newTask.Description;