first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

JavaScript: Time Stamp Function

//(c) 1998 Bryan Wilhite //All rights reserved. //rasx@kintespace.com

function jsTimeStamp() { dateobj = new Date(document.lastModified) this.month = dateobj.getMonth() + 1 this.day = dateobj.getDate() this.year = dateobj.getYear() }

function jsGetTS() { //This function intends to be backward-compatible //with older browsers. It is not aware of the getFullYear() function!

var objTS = new jsTimeStamp()
vDate = ""

if(objTS.month == 1) { vDate = "January " }
if(objTS.month == 2) { vDate = "February " }
if(objTS.month == 3) { vDate = "March " }
if(objTS.month == 4) { vDate = "April " }
if(objTS.month == 5) { vDate = "May " }
if(objTS.month == 6) { vDate = "June " }
if(objTS.month == 7) { vDate = "July " }
if(objTS.month == 8) { vDate = "August " }
if(objTS.month == 9) { vDate = "September " }
if(objTS.month == 10) { vDate = "October " }
if(objTS.month == 11) { vDate = "November " }
if(objTS.month == 12) { vDate = "December " }
        
vDate = vDate + objTS.day + ", "
        
if (0 >= objTS.year > 98) { vDate = vDate + (2000 + objTS.year) }
else { vDate = vDate + (1900 + objTS.year) }
        
return vDate

}

mod date: 2000-12-21T17:33:52.000Z