# 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());
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://inscada.gitbook.io/ins/en-1/programing/apis/date-time-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
