Today’s date and time

Here is an easy tip how to get the current date & time.

Today’s date and time

 

Source code

function getCurrentDate() {
  var dt = new Date();
  Browser.msgBox("Today: " + dt);
}

 

Format

new Date()

 

Parameters

None

 

Responses

string

 

How to change the time zone?

The value depends the time zone setting of the Project properties.

If you want to config it, please access “File” -> “Project properties”.

Leave a Comment