# TimeSpan Object

## Giới Thiệu

TimeSpan để lưu trữ 1 khoảng thời gian, TimeSpan thường được sử dụng với mục đích đo lường.

## Khởi Tạo

| Tham Số | Kiểu Dữ Liệu | Giới Thiệu |
| ------- | ------------ | ---------- |
| NDay    | Số nguyên    | Số ngày    |
| NHour   | Số nguyên    | Số giờ     |
| NMinute | Số nguyên    | Số phút    |
| NSecond | Số nguyên    | Số giây    |

## Ví Dụ

Khởi tạo 1 biến kiểu timespan có giá trị là 3 ngày, 2 giờ, 24 phút, 14 giây.

<figure><img src="/files/vnq5uOkse8gggpFiXTDd" alt=""><figcaption></figcaption></figure>

## Các Thuộc Tính Của TimeSpan Object

Giá trị thuộc tính sẽ được tính toán tự động từ tổng ngày, giờ, phút, giây và làm tròn thành số nguyên.

<table><thead><tr><th width="247">Thuộc Tính</th><th>Mô Tả</th></tr></thead><tbody><tr><td><a href="/pages/YkaoNGosOsx3EoEHWJ2v">Timespan.GetDays</a></td><td>Lấy ra tổng số ngày trong TimeSpan</td></tr><tr><td><a href="/pages/HalMgyjH9v5uzOBkUE8A">Timespan.GetHours</a></td><td>Lấy ra tổng số giờ trong TimeSpan</td></tr><tr><td><a href="/pages/Xopo9WOMlTKrnckOK1Rj">Timespan.GetMinutes</a></td><td>Lấy ra tổng số phút trong TimeSpan</td></tr><tr><td><a href="/pages/W7VgjkKHevNpBBRCSJue">Timespan.GetSeconds</a></td><td>Lấy ra tổng số giây trong TimeSpan</td></tr></tbody></table>


---

# 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://docs.taiamk.pro/function-ho-tro/datetime/timespan-object.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.
