Skip to content

Commit

Permalink
docs: datetime routines
Browse files Browse the repository at this point in the history
  • Loading branch information
dstala committed Mar 28, 2024
1 parent 26aafc2 commit b171223
Showing 1 changed file with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,62 @@ Returns the day of the week as an integer between 0 and 6 (inclusive), with Mond

---

## DATESTR
The DATESTR function converts a date or datetime field into a string in "YYYY-MM-DD" format.

#### Syntax
```plaintext
DATESTR(date | datetime)
```

#### Sample
```plaintext
DATESTR('2022-03-14') => 2022-03-14
DATESTR('2022-03-14 12:00:00') => 2022-03-14
```

#### Remark
This function converts a date or datetime field into a string in "YYYY-MM-DD" format, ignoring the time part.

---

## DAY
The DAY function returns the day of the month as an integer.

#### Syntax
```plaintext
DAY(date | datetime)
```

#### Sample
```plaintext
DAY('2022-03-14') => 14
DAY('2022-03-14 12:00:00') => 14
```

#### Remark
This function returns the day of the month as an integer between 1 and 31 (inclusive).

---

## MONTH
The MONTH function returns the month of the year as an integer.

#### Syntax
```plaintext
MONTH(date | datetime)
```

#### Sample
```plaintext
MONTH('2022-03-14') => 3
MONTH('2022-03-14 12:00:00') => 3
```

#### Remark
This function returns the month of the year as an integer between 1 and 12 (inclusive).

---

## Related Articles
- [Numeric and Logical Operators](015.operators.md)
Expand Down

0 comments on commit b171223

Please sign in to comment.