‎11-07-2015 05:57 PM
I am trying to grab the current date dynamically. What is the best way for me to grab the date in this format?
Saturday, November 7, 2015
I will be doing this in a UI page if that helps any.....
Solved! Go to Solution.
‎11-07-2015 08:36 PM
var inputDate = new GlideDateTime();
var initialDateTimeFormat = new Packages.java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
var initialFormattedDate = initialDateTimeFormat.parse(inputDate);
var finalDatetimeFormat = new Packages.java.text.SimpleDateFormat("EEEE,MMMM dd,yyyy");
gs.print(finalDatetimeFormat.format(initialFormattedDate));
‎11-07-2015 07:15 PM
I am still very new to Service Now, and do not know the full capabilities of using JavaScript within it. However, with that in mind, I hope this helps get you started:
http://stackoverflow.com/questions/1531093/how-to-get-current-date-in-javascript
‎11-07-2015 08:36 PM
var inputDate = new GlideDateTime();
var initialDateTimeFormat = new Packages.java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
var initialFormattedDate = initialDateTimeFormat.parse(inputDate);
var finalDatetimeFormat = new Packages.java.text.SimpleDateFormat("EEEE,MMMM dd,yyyy");
gs.print(finalDatetimeFormat.format(initialFormattedDate));
‎11-08-2015 08:55 AM
Is there anyway to get this into eastern time? It is putting it 5 hours ahead for me....
‎11-08-2015 08:59 AM