5 Replies Latest reply on Sep 1, 2016 3:01 PM by Sanford Whiteman

    Email scripting datetime with AM vs. PM

      Hey Marketo community,


      Might anyone have suggestions for adding AM vs. PM to the output of the script below. A sample of the current output is "Thursday September 1, 2016 5:00". I want to have "...5:00 AM" or "...5:00 PM". Thanks in advance for the help.


      #set($dateObj = $convert.parseDate(${Milestone1_Project__cList.get(0).Customer_Approval_Call_Date__c}, 'yyyy-MM-dd hh:mm'))

      ## Convert to a calendar objectand perform time zone adjustments

      #set($calendarObj = $convert.toCalendar($dateObj))

      #if (${Milestone1_Project__cList.get(0).Time_Zone__c} == "EST")



      #elseif (${Milestone1_Project__cList.get(0).Time_Zone__c} == "CST") 



      #elseif (${Milestone1_Project__cList.get(0).Time_Zone__c} == "MST") 



      #elseif (${Milestone1_Project__cList.get(0).Time_Zone__c} == "PST") 




      $date.format('EEEE MMMM d, yyyy h:mm',$calendarObj)