Error message: "getFullYear() is not a function". What is the correct function to get year from date

I set this var

var InstallYear=InstallDate.getFullYear(); 

and I get this error

getFullYear() is not a function

what is the correct function to get the year from a date/time field?

Do you need to do this in Javascript?

You could create UI Only field and use the “Year” function.

If you need to hang out in Javascript - you will probably need to convert the SF date to a JS date. Look for the skuid utility API: parseSFDate( sfDate )