Modified num() builtin function to support Date values.