Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

GlideDateTime not returning expected value

IreneBest
Tera Contributor

I have created a notification email script to extract the date from a field.  I have defined this as follows:

 

var dateTime = new GlideDateTime(current.apt_start_time);

 

This returns the value 2023-11-09 02:30:00

 

The actual value of the field (Appointment start time: ${apt_start_time}) is:

 

09-11-2023 13:00

 

Actual script is as follows:

 

var dateTime = new GlideDateTime(current.apt_start_time);
    var time = dateTime.getTime();

    time = time.getByFormat('h:mma');
    time = time.toLowerCase();

    template.print(dateTime);
 
Any suggestions on what I am doing wrong?
0 REPLIES 0