Monday, March 5, 2012

Javascript to get current date: m/d/yyyy

I used the following javascript in Selenium IDE to get the current date in the format m/d/yyyy (ex: 2/5/2012 or 12/10/2012).  No zero's preceed the month and day.

storeEval var d=new Date(); ((d.getMonth()+1))+'/'+d.getDate()+'/'+d.getFullYear(); date1