Need help for convert string to date or number in HTML view

Need help for convert string to date or number in HTML view

Hi 
 
Why  can't convert a string variable to date or number in HTML view by using  toDate() or toLong()  built-in function? I try to so many times it's can't save the script like bellow:





Waiting your help and thanks

Stanley