[thelist] "Local" Hosting - why?

Mike Hardaker mike at angloinfo.com
Thu May 10 14:30:53 CDT 2001


<tip>
> (Sitting in Texas ... with his personal site hosted in Australia where the
> "non-US-centric" local date/time formatting occasionally causes him some
> dismay but elsewise life is pretty good.)

Sitting in France, I use this effective (if inelegant) ASP fragment to deal
with local times on East Coast USA - reflecting the different dates when DST
kicks in:

<%
Dim nw, os, mDate, mEnd, strTimeAdjust, thisyear, aDate, strTime
nw = now
thismonth = Month(nw)
If thismonth = 3 or ThisMonth = 4 then
	thisyear = Year(nw)
	os = 31
	mDate = dateserial(thisyear, 3, os)
	mEnd = Weekday(mdate, 1)
	if mEnd <> 1 Then
		os = 32 - mEnd
		mdate = dateserial(thisyear, 3, os)
	end if
	aDate = DateAdd("d", 7, mDate)
	If nw > mDate AND nw < aDate then
		strTimeAdjust = 7
	Else
		strTimeAdjust = 6
	End If
Else
	strTimeAdjust = 6
End If
strTime = DateAdd("h", strTimeAdjust , Now())
strTime = "Page generated at " & FormatDateTime(strTime, 4) & "; " &
FormatDateTime(strTime, 1)
%>
</tip>





More information about the thelist mailing list