function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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;