> For the complete documentation index, see [llms.txt](https://inscada.gitbook.io/ins/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://inscada.gitbook.io/ins/en-1/programing/apis/date-time-functions.md).

# Date-Time Functions

The Date-Time functions are used for the date-time read and write operations of the system where the inSCADA Platform is installed.

## Get System Date-Time

#### Date ins.now()

Returns the system time.

Return Value: Returns the return value of Java Date Object.

#### Syntax

```javascript
var year=1900+ins.now().getYear();
var month=ins.now().getMonth()+1;
var day=ins.now().getDate();
var hour=ins.getHours();
var minute=ins.getMinutes();
var second=ins.getSeconds();

return "Date Time : "+day+"/"+month+"/"+year+" "+hour+":"+minute+":"+second;
```

## Set System Date-Time

#### ins.setSystemDateTime(Long ms)

Changes the system time.

ms: The number of milliseconds since midnight January 1, 1970.

Return Value: Does not return any value.

#### Syntax

```javascript
var dt=new Date();
dt.setHours(5);
ins.setDateTime(dt.getTime());
```
