Best Practice for handling GlideDateTime ObjectIssue TL;DR: Constructing GlideDateTime object using String input should be avoided as it can lead to unintended consequences. It is always advised to use GlideDateTime object where possible. The GlideDateTime class provides methods for performing operations on GlideDateTime objects. You can use the GlideDateTime methods to perform date-time operations, such as instantiating a GlideDateTime object, performing date-time calculations, formatting a date-time, or converting between date-time formats. You can instantiate a GlideDateTime object to specific date-time by using one of following: GlideDateTime(String dateTime), e.g. 08-05-2025 11:34:48 or display value of GlideDateTime objectGlideDateTime(GlideDateTime gdt), e.g. GlideDateTime object Note: GlideDateTime object directly returns the date and time value in the GMT time zone. getDisplayValue() gets the date and time value in the current user's display format and time zone. In the following example, the due_date field on the incident records is set to 08-05-2025 11:34:48 (May 08, 2025 11:34:48) In the script output below, we can see that when we use the date string to create GlideDateTime Object, the date-time is incorrectly translated as Aug 5, 2025 21:34:48 instead of May 8, 2025 11:34:48 var gr = new GlideRecord("incident"); if (gr.get("e58861093b45e610378b9d1d16e45afd")) { var due_date = gr.getValue("due_date"); // GlideDateTime Object var due_date_display_value = gr.due_date.getDisplayValue(); // Date String gs.info("Due Date (GMT): " + due_date) gs.info("Due Date (Display Value): " + due_date_display_value + "\n"); var gdt = new GlideDateTime(due_date); var gdt_display_value = new GlideDateTime(due_date_display_value); // Set user session time zone since GlideDateTime object is in GMT var tz = gs.getSession().getTimeZone(); gdt.setTZ(tz); gs.info("Using GlideDateTime Object: " + gdt.getDisplayValueLang("medium")); gs.info("Using Date String: " + gdt_display_value.getDisplayValueLang("medium")); } Output: *** Script: Due Date (GMT): 2025-05-08 01:34:48 *** Script: Due Date (Display Value): 08-05-2025 11:34:48 *** Script: Using GlideDateTime Object: May 8, 2025 11:34:48 *** Script: Using Date String: Aug 5, 2025 21:34:48ReleaseAllCauseThe reason for this is, as mentioned in the documentation, the system attempts to match the passed-in Date String with the specified internal system format. If the argument does not match the system format, the system attempts to match it to one of the following formats in this order: yyyy-MM-dd HH:mm:ssMM/dd/yyyy HH:mm:ssMM-dd-yyyy HH:mm:ss ... In our example, the provided Date String 08-05-2025 11:34:48 doesn't match the internal system format. Hence it matches to the format MM-dd-yyyy HH:mm:ss as specified in the ordered list above and incorrectly interprets day as month and vice versa. Please note that this issue is not reproduced if day of month is 13 or higher as there cannot be more than 12 months in a year and system will correctly interpret the date. Furthermore, since GlideDateTime object processes date-time in GMT time zone, we can see time zone offset is applied twice when trying to display Date String.ResolutionConstructing GlideDateTime object using String input should be avoided as it can lead to unintended consequences. It is always advised to use GlideDateTime object where possible.Related LinksDo not use gs.nowDateTime() or GlideDateTime.getDisplayValue() in a GlideDateTime constructor