# Javascript Date & Time pulls file

**URL:** <https://forum.kirupa.com/t/javascript-date-time-pulls-file/158785>\
**Category:** web dev\
**Created:** [August 11, 2005, 9:06pm UTC](https://forum.kirupa.com/t/javascript-date-time-pulls-file/158785 "2005-08-11T21:06:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wyclef](https://avatars.discourse-cdn.com/v4/letter/w/65b543/32.png) [@wyclef](https://forum.kirupa.com/u/wyclef)\
**Post date:** [August 11, 2005, 9:06pm UTC](https://forum.kirupa.com/t/javascript-date-time-pulls-file/158785/1 "2005-08-11T21:06:55Z")

</div>

This is a Javascript that pulls a flash file at 4 different times of day. Would there be a way to fix this to have 4 different sets of files each containing 4 files each set getting upulled from different times of year with the times changing? Does this make sense?

```auto

<!-- 
function writeFlash(){

	whichFlashFile = "";
	mydate=new Date(); 
	date=mydate.getHours() 
	if (date >= 5 && date < 10) { 							
		whichFlashFile="a.swf"; 
	} else if (date >= 10 && date < 19) {					
		whichFlashFile="b.swf"; 
	} else if (date >= 19 && date < 22) {
		whichFlashFile="c.swf"; 	
	} else {
		whichFlashFile="d.swf"; 
	}

/*--------------------------------------------------
   Set Flash File
--------------------------------------------------*/
	var oeTags = '<object type="application/x-shockwave-flash"'
	+ 'data="'+whichFlashFile+'"'
	+ 'width="100%" height="100%">'
	+ '<param name="movie" value="'+whichFlashFile+'" />'
	+ '</object>';

	document.write(oeTags);
}

//-->

```
