asNumber() now supports Date objects

Change-Id: Idf0ef934f374f25ac784eb9b87df30f8199d18a9