Date Calculator

Hi,
I want make an date calculation like-
i will pick a date, then
it will show 56 days back date and other will show after 55 days Date.
how do i make it. please advise..

thanks

WhatsApp Image 2024-03-15 at 11.52.48 PM

Hello,

convert the selected date to milliseconds, then calculate 55 days in milliseconds and add both. Convert again to date format.
The same with 56 days back. It would be something like this:

there is also the AddDays method in the clock component you could use...

https://ai2.appinventor.mit.edu/reference/components/sensors.html#Clock

Taifun

1 Like

thanks a lot, its solved.

can u please guide me one more option-
need to calculate: how many days between those 2 date. total days? and others option need Year, Month and day.

thanks for your help

But different months have different lengths.
How do you plan to count them? By multiples of 30 days? By name change?

You can use Duration block:

I'm not sure what do you want here...can you explain it (maybe with an example).

According to actual Month day please.


date_differences.aia (4.0 KB)

Designer:


Sample  run

1 Like

I want like this.

For that last point @ABG has has offered you a perfect solution in the previous answer.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.