FlyerTalk Forums - View Single Post - Has Anyone Bought This Book-Secret To Cheap Flights?
Old Jan 1, 2010 | 9:51 am
  #10  
Efrem
FlyerTalk Evangelist
40 Countries Visited
3M
All eyes on you!
25 Years on Site
 
Join Date: May 1998
Location: Massachusetts, USA; AA 2.996MM & Plat Pro, DL 1MM, GM & Flying Colonel
Posts: 25,019
Originally Posted by baliktad
...My psychic powers tell me that if you refresh the page after midnight local time, it will magically now be updated in January 2010! Heck, just change the time on your computer to any month you like and watch the updates come rolling in!...
Don't need psychic powers. For the geeks or merely geek-curious among us, here's the code behind the "magic:"

<script language="JavaScript" type="text/javascript">

<!--

function makeArray() {

for (i = 0; i<makeArray.arguments.length; i++)

this[i + 1] = makeArray.arguments[i];

}

var months = new makeArray('January','February','March','April','Ma y','June', 'July','August','September','October','November',' December');

var date = new Date();

var day = date.getDate();

var month = date.getMonth() + 1;

var yy = date.getYear();

var year = (yy < 1000) ? yy + 1900 : yy;

document.write(months[month] + " " + " " + year);
Doesn't do much for his credibility, IMHO.
Efrem is offline