We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

setDisplayValue is not converting this date format properly 'MM/dd/yy HH:mm:ss'

Brian Terrick
Tera Contributor

When attempting to convert a string in this format 'MM/dd/yy HH:mm:ss' to 'yyyy-MM-dd HH:mm:ss' setDisplayValue does not return the proper year.

 

Example:

Original: 01/02/25 10:50:40

Returns: 0025-01-02 15:50:40

 

5 REPLIES 5

Ankur Bawiskar
Tera Patron

@Brian Terrick 

please share your script

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader