Page 1 of 1

System Date -15 Years

Posted: Sat Mar 08, 2008 11:56 pm
by ds2000
I want to a compare of date (yyyy-mm-dd) with system date -15 years in Transformer in px. What functions should i use.

Posted: Sun Mar 09, 2008 12:30 am
by ray.wurlod
Depends how accurately you need it. You could use DateFromDaysSince() if you're happy to say that 15 years is 5479 days. Otherwise you need to break the date into its components, using YearFromDate(), MonthFromDate() and DayFromDate(), subtract 15 from the year component, re-assemble the date, subtracting 1 from the day if the date is Feb 29, using DateFromString(). The integers will cast implicitly to strings.

Posted: Mon Mar 10, 2008 1:11 pm
by ds2000
It works fine..Thanks Ray.