Returning current date


Function to return todays date as a string


To return the result into a control:

[Control Name] = new Date();

To return the result into a variable:

[var_VARIABLENAME] = new Date();
You can format the date however you like by using the following process:
var Today = new Date();
var MyDay = Today.getDate();
var MyMonth = Today.getMonth()+1;
var MyYear = Today.getFullYear();
[Control Name] = MyDay + '/' + MyMonth + '/' + MyYear;


[var_VARIABLENAME] = MyDay + '/' + MyMonth + '/' + MyYear;

To replace the numbers for text use the following:

var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var MyMonth = months[Today.getMonth()];