I have the following javascript function which I need written in vbscript. Would any of you fine people out there care to help a poor fellow out? I only need to return a date/time value.
Basically I need a "negative date" for sorting purposes. The table that stores this value actually has a field for this value. The key is the "future" date.
Basically I need a "negative date" for sorting purposes. The table that stores this value actually has a field for this value. The key is the "future" date.
Code:
function getNegDatestamp(datestamp) {
var future = new Date(2200,0,2);
var delta = future - datestamp;
var days = Math.floor(delta/86400000);
var hours = Math.floor((delta - (days*86400000))/3600000);
var minutes = Math.floor((delta - (days*86400000) - (hours*3600000))/60000);
var seconds = Math.floor((delta - (days*86400000) - (hours*3600000) - (minutes*60000) )/1000);
var negdatestamp = new XMLDate( "P"+days+"DT"+hours+"H"+minutes+"M" +seconds+"S");
return negdatestamp.getDatum();
}