The GlideDateTime class is specifically used for Date and Time values, as recommended by ServiceNow best practices. This is supported by the Glide API as well.
Formatting and conversion of Date and Time values can be achieved through the GlideDateTime class.
See more results on Neeva
Summaries from the best pages on the web
The GlideDateTime is specifically for the Date and Time Value you can simply able to achieve the same through the Glide API as well but then the ServiceNow best practice is saying for the Date and Time values, formatting , conversion user the GlideDateTime class.
ServiceNow glidedatetime | DxSherpa
gdt.addDaysLocalTime(-1); //add 3 weeks gdt.addWeeksLocalTime(3); //subtract 6 months gdt.addMonthsLocalTime(-6); //add 1 year, representing the date and time ...
Modify a GlideDateTime field value