main.m791 chars25 lines
The idea of the function is to calculate the next birthday from "now" and return the number of days difference between "now" and that date. If the calculated birthday is already past in the current year, we add one year to the birthday to get the next one. We use the days
function to calculate the difference in days between two datetime objects.
To use the function, just call it with the person's birthday in year-month-day format (as separate arguments, not as a single string). Here's an example usage:
main.m112 chars7 lines
This means that if the person with birthday March 12, 1990 were still alive, their next birthday would be in 77 days from today.
gistlibby LogSnag