
PRO
dbeard
USA
Asked
— Edited

Has anyone a piece of script code that will calculate how many days have past since the current date? I need to do the calculation, but I believe the dates are alphanumeric and not numeric and cant figure it out.
This interests me too. I have often wanted to try it but other more important things come up.
It is actually numeric. You need to do something like this:
How do you handle the calculation if the time spans multiple months?
@dbeard.
I've posted the following link to a thead where I asked for script advice for a robot to say exactly how old it is. It uses the day, month ect, variables to set an age and then calculates his age using the computers clock whenever asked. You might be able to get some useful info from the scripts @Rich posted for me, as they are based on the same princible to what you're looking for. Hopefully you can find some useful elements from the scripts to make what you're looking to do. Hope it helps.
Asking a robot for its age scripts
Steve, thanks for the information. but I need it down to the day level, not years. I cant figure out how to count the days, when some months have more days then others. I am trying to figure out the number of days that have elapsed over time.
If you are going to use a database as your other pose suggests, I would pass the dates to a function in the database to do this. It would have a date different function.
No, actually two different things. The date calculation is to count days, unrelated to the calendar. more of an elapsed days counter.
If you have the tools available in the database, why not just use them to do what you need to do? If you have it, use it. It can easily be passed back into ARC via a variable. As you would want an app to access the database anyway, you could also just do the date diff function inside of the app. You can pass switches to the application to have it perform specific tasks. You would also be able to include the dates you want to compare.
It might be possible in a script. I don't know. I personally call could based services to do this. Wolfram alpha allows personal users to make an api that can handle 2000 calls a month. It handles these types of questions very well.