tufanv Expert Licensed User Longtime User May 21, 2013 #1 Hello, Is it possible to add days to a date and find the new date .? For example the user enter a date of 15/9/1987 . The app must add 25 days to it and give the new result of : 10/10/1987 . Is it possible ? Thank you
Hello, Is it possible to add days to a date and find the new date .? For example the user enter a date of 15/9/1987 . The app must add 25 days to it and give the new result of : 10/10/1987 . Is it possible ? Thank you
nrasool Member Licensed User Longtime User May 21, 2013 #2 Yes, Datetime.add would be want you want to use, eg an example is B4X: Dim 25Date As Long Dim 25Date = DateTime.Add(DateTime.Now, 0, 0, 25) Kind Regards Upvote 0
Yes, Datetime.add would be want you want to use, eg an example is B4X: Dim 25Date As Long Dim 25Date = DateTime.Add(DateTime.Now, 0, 0, 25) Kind Regards
tufanv Expert Licensed User Longtime User May 21, 2013 #3 Thank you I got it but i dont want to add it to datetime.now i want to add it to a specific date. How can i add it to a specific date ? Upvote 0
Thank you I got it but i dont want to add it to datetime.now i want to add it to a specific date. How can i add it to a specific date ?
D drachmad Member Licensed User Longtime User May 21, 2013 #4 Change the datetime.now with DateTime.DateParse("05/01/2013") Upvote 0
nrasool Member Licensed User Longtime User May 21, 2013 #5 Instead of using datetime.now, you would use the date.input. If in your code you had an example of B4X: Dim Dd As DateDialog Dim return as int return = Dd.Show("Date", "Test", "Save", "Cancel","Np",Null) Then using the above would be B4X: Dim 25Date As Long Dim 25Date = DateTime.Add(dd.input, 0, 0, 25) I'm using agraham dialog library, don't know about standard, but it shouldn't be that different Kind Regards Upvote 0
Instead of using datetime.now, you would use the date.input. If in your code you had an example of B4X: Dim Dd As DateDialog Dim return as int return = Dd.Show("Date", "Test", "Save", "Cancel","Np",Null) Then using the above would be B4X: Dim 25Date As Long Dim 25Date = DateTime.Add(dd.input, 0, 0, 25) I'm using agraham dialog library, don't know about standard, but it shouldn't be that different Kind Regards
tufanv Expert Licensed User Longtime User May 21, 2013 #6 thank you very much for the help ! Upvote 0