> For the complete documentation index, see [llms.txt](https://docs.taiamk.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.taiamk.pro/function-ho-tro/datetime/dayofweek.md).

# DayOfWeek

## Giới Thiệu

Function giúp chúng ta có thể lấy được thứ tự của ngày trong tuần bắt đầu như sau.

<table><thead><tr><th width="170">Thứ</th><th>Ngày Trong Tuần</th></tr></thead><tbody><tr><td>Chủ Nhật</td><td>0</td></tr><tr><td>Thứ Hai</td><td>1</td></tr><tr><td>Thứ Ba</td><td>2</td></tr><tr><td>Thứ Tư</td><td>3</td></tr><tr><td>Thứ Năm</td><td>4</td></tr><tr><td>Thứ Sáu</td><td>5</td></tr><tr><td>Thứ Bảy</td><td>6</td></tr></tbody></table>

Function nhận vào giá trị kiểu DateTime

<figure><img src="/files/oPTKaP6OJJUfJnRVkPmf" alt="DayOfWeek"><figcaption><p>Lấy thứ tự ngày trong tuần</p></figcaption></figure>

## Kết Quả

Với dữ liệu thời điểm viết bài là chủ nhật thì function trả về kết quả như hình bên dưới.

<figure><img src="/files/gl4i4TTlRIknFSuC3F9c" alt="DayOfWeek"><figcaption><p>Kết quả chạy function lấy về hôm nay là 0</p></figcaption></figure>
