I need to see the raw value of ${lead.apptBookedTime} for this same lead, in the same context (simply add that line to the end of the script, after a <br> to make it readable).
Also please use the syntax highlighter when pasting code.
In addition to the above, if I simply input ${lead.apptBookedTime}
Output is:
Appointment time: 2018-02-12 23:00:00
OK, so we're back to the format
"yyyy-MM-dd HH:mm:ss"
You can't parse a string as
"yyyy-MM-dd'T'HH:mm"
If it doesn't actually have the T character!
In addition, if it's coming out as 11:00am the day before, it's clear that this data is being output in something other than Australia/Sydney (your pod time and instance time are not the same). It looks like US Central time, the common pod time.
So you want:
#set( $inTimeZone = $date.getTimeZone().getTimeZone('America/Chicago') )
#set( $outTimeZone = $date.getTimeZone().getTimeZone('America/Sydney') )
#set( $locale = $date.getLocale() )
#set( $myDate = $convert.parseDate(${lead.apptBookedTime},"yyyy-MM-dd HH:mm",$locale,$inTimeZone) )
${date.format('hh:mm a',$myDate,$locale,$outTimeZone)}
I see what you mean. It looks like that worked .
Amazing, thanks so much for your help!
Sure, glad it's working.
This entire thread was super helpful for troubleshooting an issue I've been having (in addition to your blog post --> https://blog.teknkl.com/velocity-days-and-weeks/#notes) Thank you so much!