[thelist] ASP & Access - Using the same variable twice

Mike Hardaker mike at angloinfo.com
Mon Nov 26 05:30:40 CST 2001


> <%
> '## Generate Netherlands time by adding 6 to east coast time


It's not *quite* that simple, as Europe and the US have different dates for the
start of Summer Time (or DST, if you prefer). So it's mostly a 6-hour gap, but
sometimes 7... Here's some less-than-elegant code that I use for France and the
East Coast:

<%
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
    TimeAdjust = 7
  Else
    TimeAdjust = 6
  End If
Else
  TimeAdjust = 6
End If
' ## strTime is the "local" time in France etc.
strTime = DateAdd("h", TimeAdjust , Now())
%>





More information about the thelist mailing list