The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get today's date in MM-DD-YYYY format without time.

hars
Kilo Expert

How to get today's date in MM-DD-YYYY format without time in script?

1 ACCEPTED SOLUTION

hars
Kilo Expert

var currentdate = new GlideDate();
currentdate.getByFormat("MM-dd-yyyy");

View solution in original post

9 REPLIES 9

Brad Tilton
ServiceNow Employee
ServiceNow Employee

new GlideDateTime.getDate(); should do the trick.

  1. "InternalError: Java class "com.glide.glideobject.GlideDateTime" has no public instance field or method named "getDate". (<refname>; line 1)"

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Oops forgot the parens: new GlideDateTime().getDate();

thanks!!