# How to find difference between two dates?

**URL:** https://community.thunkable.com/t/how-to-find-difference-between-two-dates/571238
**Category:** Questions about Thunkable X
**Tags:** beginner, question, help
**Created:** [May 16, 2020, 6:02pm UTC](https://community.thunkable.com/t/how-to-find-difference-between-two-dates/571238 "2020-05-16T18:02:39Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![sgirishdds](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@sgirishdds](https://community.thunkable.com/u/sgirishdds)
#### Post date: [May 16, 2020, 6:02pm UTC](https://community.thunkable.com/t/how-to-find-difference-between-two-dates/571238/1 "2020-05-16T18:02:39Z")

</div>

I am trying to find the number of days between two dates. Is there any way to find it in CROSS PLATFORM?

---

<div class="post-metadata">

### Author: ![mythi](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mythi/32/70585_2.png) [@mythi](https://community.thunkable.com/u/mythi)
#### Post date: [May 16, 2020, 7:31pm UTC](https://community.thunkable.com/t/how-to-find-difference-between-two-dates/571238/2 "2020-05-16T19:31:22Z")

</div>

Hello, this is a snippet from a project I made to calculate the differences between two dates (although the second date is the current date, so you’ll just have to replace it). Please note this does not include year, my project did not need that. You can just check if the years are equal and if not add 365 (check if it is a leap year, though).

[https://x.thunkable.com/copy/96c4399a014ae6500ed78af11ab8d968](https://x.thunkable.com/copy/96c4399a014ae6500ed78af11ab8d968)

Sorry this is not a complete answer, it’s just to give you a starting place and some ideas.

---

<div class="post-metadata">

### Author: ![dlmetzgerbcch](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dlmetzgerbcch](https://community.thunkable.com/u/dlmetzgerbcch)
#### Post date: [May 23, 2020, 3:32am UTC](https://community.thunkable.com/t/how-to-find-difference-between-two-dates/571238/3 "2020-05-23T03:32:16Z")

</div>

So I was looking for a non-API way of doing this, and I stumbled across Julian dates. Pretty nerdy, but there is an explanation here: [https://stason.org/TULARC/society/calendars/2-15-1-Is-there-a-formula-for-calculating-the-Julian-day-nu.html](https://stason.org/TULARC/society/calendars/2-15-1-Is-there-a-formula-for-calculating-the-Julian-day-nu.html) and countless more explanations online, but I found this the simplest to put into blocks. Julian dates takes into account leap years and leap centuries, and this is a mathematically accepted way of finding the difference between two dates. In this example, the date picked FDOM is converted to a Julian date DOM. My variables L, M, S correspond to a, y, and m, respectively, in this link with the formula. To find the difference between two dates, subtract the Julian dates.

 ![Julian Date](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/7/474ce6aaf65369731e8f7bb0edbe4f2a3f72c8df.jpeg)

---

<div class="post-metadata">

### Author: ![sommaikaipakkad4nitr](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@sommaikaipakkad4nitr](https://community.thunkable.com/u/sommaikaipakkad4nitr)
#### Post date: [December 13, 2023, 1:08pm UTC](https://community.thunkable.com/t/how-to-find-difference-between-two-dates/571238/4 "2023-12-13T13:08:24Z")

</div>

Sorry to bother you, I can’t access your link. What should I do?

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [December 13, 2023, 3:48pm UTC](https://community.thunkable.com/t/how-to-find-difference-between-two-dates/571238/5 "2023-12-13T15:48:37Z")

</div>

This topic is over two years old so you may need to just copy the blocks in the screenshot above. Another option is to use a javascript to calculate what you need. I believe there are examples on the forum if you search.

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [November 8, 2024, 11:29am UTC](https://community.thunkable.com/t/how-to-find-difference-between-two-dates/571238/6 "2024-11-08T11:29:02Z")

</div>


