Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wangbar or anyone... 1

Status
Not open for further replies.

BigBadDave

Programmer
Joined
May 31, 2001
Messages
1,069
Location
EU
...here is the actiob script for my time :

Code:
function datetime (foo) {
	var dateToday = new Date();
	var TimezoneOffset = dateToday.getTimezoneOffset();
	var fiddle = -1;
	dateToday.setTime(dateToday.getTime()+TimezoneOffset*fiddle*60*1000+foo*60*60*1000);
	var amOrPm;
	hoursFinal = dateToday.getHours();
	if (hoursFinal<12) {
		amOrPm = &quot;am&quot;;
	} else {
		hoursFinal = hoursFinal-12;
		amOrPm = &quot;pm&quot;;
	}
	if (hoursFinal == 0) {
		hoursFinal = 12;
	}
	minutesFinal = dateToday.getMinutes();
	minutesFinal = minutesFinal.toString();
	if (minutesFinal.length == 1) {
		minutesFinal = '0'+minutesFinal;
	}
	secondsFinal = dateToday.getSeconds();
	secondsFinal = secondsFinal.toString();
	if (secondsFinal.length == 1) {
		secondsFinal = '0'+secondsFinal;
	}
	current_time = hoursFinal+':'+minutesFinal+'.'+secondsFinal+amOrPm+' ';
	var dayFinal = dateToday.getDay();
	var dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
	dayFinal = dayNames[dayFinal];
	var dayNumber = dateToday.getDate();
	var monthFinal = dateToday.getMonth();
	var monthNames = ['January', 'Febuary', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
	monthFinal = monthNames[monthFinal];
	var yearFinal = dateToday.getFullYear();
	return current_time+dayFinal+'  '+dayNumber+'  '+monthFinal+',  '+yearFinal;
}
this.timeZone0.timeZone = datetime(-12);
this.timeZone1.timeZone = datetime(-8);
this.timeZone2.timeZone = datetime(-4);
this.timeZone3.timeZone = datetime(0);
this.timeZone4.timeZone = datetime(4);
this.timeZone5.timeZone = datetime(8);
this.timeZone6.timeZone = datetime(12);

Is this right for setting timezoneoffset ?? Regards

Big Dave

davidbyng@hotmail.com


** If I am wrong I am sorry, but i'm only trying to help!! **

 
If the 6th time is supposed to be New York time (EST), yes it would be right! But you took out city names so... Can't really say!

One other thing, I've read complaints of Autralians saying Flash was bugged as for their own time (+ or - 1 hour, I forget...), and this is apparently a fact recongnised by Macromedia. Hope it will be fixed in Flash 6!

Regards,
wink4.gif
ldnewbie
 
nice one..saving that for myself..
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top