Link to home
Start Free TrialLog in
Avatar of Aleks
AleksFlag for United States of America

asked on

function not working on ASP/VB page

I have the following function which works fine on ASP/Javascript page but not on an ASP/VBscript page:

 <% function todayStr() {
var today=new Date()
return today.getMonth()+1+"/"+today.getDate()+"/"+(today.getYear())
}
%>

I would need the syntax for the ASP/Vb page :)
Avatar of Big Monty
Big Monty
Flag of United States of America image

are you trying to get todays date in MM/DD/YY format? you can just use the FormatDateTime built in function:

today = FormatDateTime( now, 2 )
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial