Subtract typed date from system date

How to subtract typed date: 07/24/1966 from current system date: 07/24/2023 to know how old the person is?

Use the methods from the clock

Taifun

1 Like

I made this one using the Date Picker but I wanted the user to enter the date

just adjust your blocks to your needs
where exactly is the problem?
Taifun

I do not know how to do this. The example I gave was if he types in the textbox the date of birth 05/17/1966 I want to get that date value and subtract from the current date to know the age.

Read again the guide mentioned above and try the Duration methods

Taifun

may be something like this?

also ref taifun suggestion and this too How to get the number of years, months and days between two dates? - #5 by Still-learning .

I took the example of the post ow to get the number of years, months and days between two dates?
I changed the two parameters start and end with the value entered by the user and the system value.

Putting only the date without formatting example: 11/05/1966 gives this error.

image

Could you let me know what’s wrong?

If you r using system time, then don’t use make instant from block. Directly use get millis. See I have tried like this and got result as I expect…


1 Like

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