I have an array of dates that I am populating adding the dates creating the types and calling their constructor like this: new Date(2008, 1, 1)
I was wondering if there is a better way to do this? I am guessing that I can use the numeric representation of Date and put that into the array on the server side and send this array down to the client. I feel that the array with the numbers will be smaller and will result a faster running jscript on the client.
I would like to know how it is possible and if this results better performance at all?
I am fairly new to jscript.
You can use
dateObject.getTime()to get the number of milliseconds since 1970 Jan 1. UsedateObject.setTime(time)for the reverse operation.Whether it has higher performance or not, you need to profile it. I think there isn’t much difference.