GlideDateTime not returning expected value
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 04:48 PM
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