DateHandler Class 

I recently had to create an age verification page for a website with some mature content. I was surprised when I did not find many examples of date handling for Flex/AS3. This DateHandler class takes a few things I found and modified and puts in a nice little package you can import into your project.

  • DateHandler.getAge(Date) – will calculate a persons age
  • DateHandler.isLeapYear(int) – will detemine whether a four digit year is a leap year or not
  • DateHandler.toDate(String) – will return a date object given a string (’mm/dd/yyyy’)

It is available in my RedLib-AS3 library in my Google Code repo.

Catetgories: code

Post a Comment