Skip to content

Commit 2e48dd0

Browse files
Create README.md
1 parent 5d284c5 commit 2e48dd0

File tree

1 file changed

+22
-0
lines changed
  • Server-Side Components/Server Side/calculate difference between two dates in years, months, and days

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Get Age in Years, Months, Days
2+
3+
This snippet calculates the difference between two dates in **years, months, and days**.
4+
A common use case is to calculate a person’s age from their birthdate or determine elapsed time between two date fields.
5+
6+
---
7+
8+
## 🔹 Inputs
9+
- `startDate` – Earlier date (e.g., Birthdate) as a `GlideDateTime`.
10+
- `endDate` – Later date (e.g., Today) as a `GlideDateTime`.
11+
12+
---
13+
14+
## 🔹 Output
15+
Returns an object in the format:
16+
17+
```json
18+
{
19+
"years": <number>,
20+
"months": <number>,
21+
"days": <number>
22+
}

0 commit comments

Comments
 (0)