Returning current day

Issue
Function to return todays day number as a string i.e. Sunday = 0 ,Monday = 1......Saturday = 6

Solution

To return the result into a control:

[Control Name] = new Date().getDay();
 
To return the result into a variable:

[var_VARIABLENAME] = new Date().getDay();