Skip to content

Commit bdd61d1

Browse files
committed
Update date-diff.md
1 parent f799da3 commit bdd61d1

File tree

1 file changed

+10
-5
lines changed
  • docs/en/sql-reference/20-sql-functions/05-datetime-functions

1 file changed

+10
-5
lines changed

docs/en/sql-reference/20-sql-functions/05-datetime-functions/date-diff.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,21 @@ This example calculates the difference in hours between **yesterday** and **toda
2626
```sql
2727
SELECT DATE_DIFF(HOUR, YESTERDAY(), TODAY());
2828

29-
-[ RECORD 1 ]-----------------------------------
30-
DATE_DIFF(HOUR, yesterday(), today()): 24
29+
┌───────────────────────────────────────┐
30+
│ DATE_DIFF(HOUR, yesterday(), today()) │
31+
├───────────────────────────────────────┤
32+
24
33+
└───────────────────────────────────────┘
3134
```
3235

3336
This example calculates the difference in years between the current date and January 1, 2000;
3437

3538
```sql
3639
SELECT NOW(), DATE_DIFF(YEAR, NOW(), TO_DATE('2000-01-01'));
3740

38-
-[ RECORD 1 ]-----------------------------------
39-
now(): 2024-10-15 03:06:37.202434
40-
DATE_DIFF(YEAR, now(), to_date('2000-01-01')): -24
41+
┌────────────────────────────────────────────────────────────────────────────┐
42+
│ now() │ DATE_DIFF(YEAR, now(), to_date('2000-01-01')) │
43+
├────────────────────────────┼───────────────────────────────────────────────┤
44+
2024-10-15 03:38:23.726599-24
45+
└────────────────────────────────────────────────────────────────────────────┘
4146
```

0 commit comments

Comments
 (0)